|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
waba.lang.Object | +--waba.util.Vector
A vector is an array of object references. The vector grows and shrinks dynamically as objects are added and removed.
Here is an example showing a vector being used:
... Vector vec = new Vector(); vec.add(obj1); vec.add(obj2); ... vec.insert(3, obj3); vec.del(2); if (vec.getCount() > 5) ...
Constructor Summary | |
Vector()
Constructs an empty vector. |
|
Vector(int size)
Constructs an empty vector with a given initial size. |
Method Summary | |
void |
add(Object obj)
Adds an object to the end of the vector. |
void |
del(int index)
Deletes the object reference at the given index. |
int |
find(Object obj)
Finds the index of the given object. |
Object |
get(int index)
Returns the object at the given index. |
int |
getCount()
Returns the number of objects in the vector. |
void |
insert(int index,
Object obj)
Inserts an object at the given index. |
void |
set(int index,
Object obj)
Sets the object at the given index. |
Object[] |
toObjectArray()
Converts the vector to an array of objects. |
Methods inherited from class waba.lang.Object |
toString |
Constructor Detail |
public Vector()
public Vector(int size)
Method Detail |
public void add(Object obj)
public void insert(int index, Object obj)
public void del(int index)
public Object get(int index)
public void set(int index, Object obj)
public int find(Object obj)
public int getCount()
public Object[] toObjectArray()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |