|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.util.IntVector
A int vector is an array of int's. The vector grows and shrinks dynamically as objects are added and removed.
Here is an example showing a vector being used:
... IntVector vec = new IntVector(); vec.add(int1); vec.add(int22); ... vec.insert(3, int3); vec.del(2); if (vec.getCount() > 5) ...
Field Summary | |
int[] |
items
|
Constructor Summary | |
IntVector()
Constructs an empty vector. |
|
IntVector(DataStream in)
Constructs an vector readen from the stream |
|
IntVector(int size)
Constructs an empty vector with a given initial size. |
Method Summary | |
void |
add(int obj)
Adds an object to the end of the vector. |
void |
del(int index)
Deletes the object reference at the given index. |
int |
find(int obj)
Finds the index of the given object. |
int |
getCount()
Returns the number of objects in the vector. |
void |
insert(int index,
int obj)
Inserts an object at the given index. |
boolean |
isBitSet(short index)
used to let this int vector act like a bit vector. returns true if the bit specified is set. you must guarantee that the index exists in the vector. guich@102 |
void |
setBit(short index,
boolean on)
used to let this int vector act like a bit vector. returns true if the bit specified is set. you must guarantee that the index exists in the vector. guich@102 |
void |
writeTo(DataStream out)
writes this int vector to the stream |
Methods inherited from class java.lang.Object |
hashCode,
toString |
Field Detail |
public int[] items
Constructor Detail |
public IntVector()
public IntVector(DataStream in)
public IntVector(int size)
Method Detail |
public void add(int obj)
public void insert(int index, int obj)
public void del(int index)
public int find(int obj)
public int getCount()
public void writeTo(DataStream out)
public boolean isBitSet(short index)
public void setBit(short index, boolean on)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |