public class FastVector
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
elementCount |
protected java.lang.Object[] |
elements |
Constructor and Description |
---|
FastVector()
Constructs a fast vector with the default size.
|
FastVector(int size)
Constructs an fast vector instance with the specified size
|
FastVector(java.lang.Object[] array) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object o)
Adds an element at the specified index
|
void |
add(java.lang.Object o)
Adds an element to the fast vector
|
void |
addArray(java.lang.Object[] o)
Adds elements to the fast vector
|
void |
clear()
This method empties the fast vector
|
boolean |
contains(java.lang.Object o) |
java.lang.Object |
elementAt(int index)
Gets the object at the specified index
|
java.util.Enumeration |
elements()
This method returns an enumeration from the fast vector
|
java.lang.Object |
get(int index)
Gets the object at the specified index
|
int |
indexOf(java.lang.Object o)
Gets the index of the specified object
|
java.util.Enumeration |
inversedElements()
This method returns an enumeration from the fast vector
This enumeration travels in the reverse order.
|
void |
moveElement(int indexSrc,
int indexDest) |
java.lang.Object |
remove(int index)
Removes the object at the specified index from the fast vector
|
java.lang.Object |
remove(java.lang.Object o)
Removes the specified object from the fast vector
|
void |
reverse() |
void |
set(int index,
java.lang.Object o) |
int |
size()
Gets the size of the fast vector
|
java.lang.Object[] |
toArray()
Return all elements contained in this Vector in an array.
|
void |
toArray(java.lang.Object[] targetArray)
This method copies the element of the vectors to a specified array
|
java.lang.String |
toString() |
public FastVector()
public FastVector(java.lang.Object[] array)
public FastVector(int size)
size
- the specified size of the fast vectorpublic void reverse()
public boolean contains(java.lang.Object o)
public void add(java.lang.Object o)
o
- the object to be addedpublic void addArray(java.lang.Object[] o)
o
- the objects to be addedpublic void add(int index, java.lang.Object o)
index
- the speciefied indexo
- the object to be addedpublic java.lang.Object remove(java.lang.Object o)
o
- the object to be removedpublic java.lang.Object[] toArray()
public java.lang.Object remove(int index)
index
- the specified index of the object to be removepublic int indexOf(java.lang.Object o)
o
- the specified objectpublic void toArray(java.lang.Object[] targetArray)
targetArray
- the array in which the elements of the fast vector will be copied inpublic int size()
public java.util.Enumeration elements()
public java.util.Enumeration inversedElements()
public java.lang.Object get(int index)
index
- the specified indexpublic void set(int index, java.lang.Object o)
public java.lang.Object elementAt(int index)
index
- the specified indexpublic void clear()
public void moveElement(int indexSrc, int indexDest)
public java.lang.String toString()
toString
in class java.lang.Object