public class CharVector extends Object implements Serializable
This class implements a simple char vector with access to the underlying array.
This work was authored by Carlos Villegas ([email protected]).
Constructor and Description |
---|
CharVector()
Construct char vector instance with default block size.
|
CharVector(char[] a)
Construct char vector instance.
|
CharVector(char[] a,
int capacity)
Construct char vector instance.
|
CharVector(CharVector cv)
Copy constructor
|
CharVector(int capacity)
Construct char vector instance.
|
Modifier and Type | Method and Description |
---|---|
int |
alloc(int size)
This is to implement memory allocation in the array.
|
int |
capacity()
Obtain capacity of array.
|
void |
clear()
Reset length of vector, but don't clear contents.
|
char |
get(int index)
Get char at index.
|
char[] |
getArray()
Obtain char vector array.
|
int |
length()
Obtain number of items in array.
|
void |
put(int index,
char val)
Pet char at index.
|
void |
trimToSize()
Trim char vector to current length.
|
public CharVector()
public CharVector(int capacity)
capacity
- initial block sizepublic CharVector(char[] a)
a
- char array to usepublic CharVector(char[] a, int capacity)
a
- char array to usecapacity
- initial block sizepublic CharVector(CharVector cv)
cv
- the CharVector that should be clonedpublic void clear()
public char[] getArray()
public int length()
public int capacity()
public void put(int index, char val)
index
- the indexval
- a charpublic char get(int index)
index
- the indexpublic int alloc(int size)
size
- to allocatepublic void trimToSize()
Copyright © 1998–2017 iText Group NV. All rights reserved.