Constructor Summary |
Vector() Constructs an empty vector using a default capacity |
Vector(int capacity) Constructs an empty vector with an initial capacity. |
Vector(int capacity, int capacityIncr) Constructs an empty vector with an initial capacity and a custom capacity increase |
Method Summary |
|
void |
addElement(Object elem) Adds an element to end of the vector |
int |
capacity() Returns the capacity of this vector |
void |
clear() Removes all elements and sets the size to 0 |
bool |
contains(Object a) Returns true if the vector contains the element 'a' |
Object |
elementAt(int index) Returns the element at index |
void |
ensureCapacity(int minCapacity) Increases the capacity to minCapacity |
bool | equals(Object a) |
void |
insertElementAt(Object obj, int index) Inserts an element at a specific index |
bool |
isEmpty() Returns true if the size of the vector is 0 |
void |
removeAllElements() Removes all elements and sets the size to 0 |
bool |
removeElement(Object elem) Remove the first occurance of elem from this vector |
void |
removeElementAt(int index) Removes an element at a specific index |
void |
setElementAt(Object obj, int index) Sets the element at index |
void |
setSize(int size) Sets the size of this vector |
int |
size() Returns the size of the vector |
Constructor Detail |
public Vector()
Constructs an empty vector using a default capacity
public Vector(int capacity)
Constructs an empty vector with an initial capacity.
public Vector(int capacity, int capacityIncr)
Constructs an empty vector with an initial capacity and a custom capacity increase
Method Detail |
public void addElement(Object elem)
Adds an element to end of the vector
public int capacity()
Returns the capacity of this vector
public void clear()
Removes all elements and sets the size to 0
This is identical to removeAllElements()
public bool contains(Object a)
Returns true if the vector contains the element 'a'
public Object elementAt(int index)
Returns the element at index
public void ensureCapacity(int minCapacity)
Increases the capacity to minCapacity
public bool equals(Object a)
public void insertElementAt(Object obj, int index)
Inserts an element at a specific index
Since:
2.6.5.7
public bool isEmpty()
Returns true if the size of the vector is 0
public void removeAllElements()
Removes all elements and sets the size to 0
This is identical to clear()
public bool removeElement(Object elem)
Remove the first occurance of elem from this vector
public void removeElementAt(int index)
Removes an element at a specific index
Since:
2.6.5.7
public void setElementAt(Object obj, int index)
Sets the element at index
public void setSize(int size)
Sets the size of this vector
public int size()
Returns the size of the vector