|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.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) ...
| Field Summary | |
java.lang.Object[] |
items
This member is public for fast access. |
| Constructor Summary | |
Vector()
Constructs an empty vector. |
|
Vector(int size)
Constructs an empty vector with a given initial size. |
|
Vector(java.lang.Object[] startingWith)
Constructs a vector starting with the given elements. |
|
| Method Summary | |
void |
add(java.lang.Object obj)
Deprecated. Use addElement method instead. |
void |
addElement(java.lang.Object obj)
Adds an object to the end of the vector. |
void |
clear()
Deprecated. Use removeAllElements method instead. |
void |
del(int index)
Deprecated. Use removeElementAt method instead. |
boolean |
del(java.lang.Object obj)
Deprecated. Use removeElement method instead. |
int |
find(java.lang.Object obj)
Deprecated. Use indexOf method instead. |
int |
find(java.lang.Object obj,
int startIndex)
Deprecated. Use indexOf method instead. |
int |
getCount()
Deprecated. Use size method instead. |
int |
indexOf(java.lang.Object elem)
Finds the index of the given object. |
int |
indexOf(java.lang.Object obj,
int startIndex)
Finds the index of the given object. |
void |
insert(int index,
java.lang.Object obj)
Deprecated. Use insertElementAt method instead. CAUTION: insertElementAt has the parameters in inverted order! |
void |
insertElementAt(java.lang.Object obj,
int index)
same of insert(index, Object), but slower, since it adds one method call |
java.lang.Object |
peek()
returns the last object, without removing it. returns null if no more elements. |
java.lang.Object |
pop()
Returns the last object, removing it. returns null if no more elements. |
void |
push(java.lang.Object obj)
pushes a object. simply calls add. |
boolean |
qsort()
Sorts the elements of this Vector. |
void |
removeAllElements()
clears all elements in this vector and sets its length to 0. |
boolean |
removeElement(java.lang.Object obj)
Deletes the object. |
void |
removeElementAt(int index)
Deletes the object reference at the given index. |
int |
size()
Returns the number of objects in the vector. |
java.lang.Object[] |
toObjectArray()
Converts the vector to an array of objects. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public java.lang.Object[] items
| Constructor Detail |
public Vector()
public Vector(int size)
public Vector(java.lang.Object[] startingWith)
| Method Detail |
public void add(java.lang.Object obj)
public void insert(int index,
java.lang.Object obj)
public void del(int index)
public boolean del(java.lang.Object obj)
public int find(java.lang.Object obj)
public int find(java.lang.Object obj,
int startIndex)
public int getCount()
public void clear()
public java.lang.Object[] toObjectArray()
public void push(java.lang.Object obj)
public java.lang.Object pop()
throws ElementNotFoundError
public java.lang.Object peek()
throws ElementNotFoundError
public int size()
public int indexOf(java.lang.Object elem)
public int indexOf(java.lang.Object obj,
int startIndex)
public void removeElementAt(int index)
public void insertElementAt(java.lang.Object obj,
int index)
public void addElement(java.lang.Object obj)
public boolean removeElement(java.lang.Object obj)
public void removeAllElements()
null,
so, if you had directly assigned an array to this vector, all items inside it will be nulled.public boolean qsort()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||