|
|||||||||
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 | |
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(Object[] startingWith)
Constructs a vector starting with the given elements. |
Method Summary | |
void |
add(Object obj)
Adds an object to the end of the vector. |
void |
addElement(Object obj)
same of add(Object) |
void |
clear()
clears all elements in this vector and sets its length to 0 |
void |
del(int index)
Deletes the object reference at the given index. |
boolean |
del(Object obj)
Deletes the object |
Object |
elementAt(int index)
same of get(index) |
int |
find(Object obj)
Finds the index of the given object. |
int |
find(Object obj,
int startIndex)
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. |
int |
indexOf(Object elem)
same of find(Object) |
int |
indexOf(Object elem,
int index)
same of find(Object, index) |
void |
insert(int index,
Object obj)
Inserts an object at the given index. |
void |
insertElementAt(Object obj,
int index)
same of insert(index, Object) |
Object |
peek()
returns the last object, without removing it. returns null if no more elements. |
Object |
pop()
returns the last object, removing it. returns null if no more elements. |
void |
push(Object obj)
pushes a object. simply calls add. |
boolean |
qsort()
Sorts the elements of this Vector. |
void |
removeAllElements()
same of clear() |
boolean |
removeElement(Object obj)
same of del(Object) |
void |
removeElementAt(int index)
same of del(index) |
void |
set(int index,
Object obj)
Sets the object at the given index. |
void |
setElementAt(Object obj,
int index)
same of set(index, Object) |
int |
size()
same of getCount() |
Object[] |
toObjectArray()
Converts the vector to an array of objects. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Field Detail |
public Object[] items
Constructor Detail |
public Vector()
public Vector(int size)
public Vector(Object[] startingWith)
Method Detail |
public void add(Object obj)
public void insert(int index, Object obj)
public void del(int index)
public boolean del(Object obj)
public Object get(int index)
public void set(int index, Object obj)
public int find(Object obj)
public int find(Object obj, int startIndex)
public int getCount()
public Object[] toObjectArray()
public void push(Object obj)
public Object pop()
public Object peek()
public void clear()
public int size()
public int indexOf(Object elem)
public int indexOf(Object elem, int index)
public Object elementAt(int index)
public void setElementAt(Object obj, int index)
public void removeElementAt(int index)
public void insertElementAt(Object obj, int index)
public void addElement(Object obj)
public boolean removeElement(Object obj)
public void removeAllElements()
public boolean qsort()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |