public class LongVector
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
elementCount |
protected long[] |
elements |
Constructor and Description |
---|
LongVector()
Constructs a int vector with the default size.
|
LongVector(int size)
Constructs an fast vector instance with the specified size
|
LongVector(long[] array) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
long v)
Adds an element at the specified index
|
void |
add(long v)
Adds an element to the fast vector
|
void |
addArray(long[] v)
Adds elements to the fast vector
|
void |
clear()
This method empties the fast vector
|
boolean |
contains(long v) |
long |
elementAt(int index)
Gets the object at the specified index
|
java.util.Enumeration |
elements()
This method returns an enumeration from the fast vector
|
int |
indexOf(long v)
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) |
int |
remove(long v)
Removes the specified object from the vector
|
long |
removeAt(int index)
Removes the object at the specified index from the fast vector
|
void |
reverse() |
int |
size()
Gets the size of the fast vector
|
long[] |
toArray()
Return all elements contained in this Vector in an array.
|
void |
toArray(long[] targetArray)
This method copies the element of the vectors to a specified array
|
java.lang.String |
toString() |
public LongVector()
public LongVector(long[] array)
public LongVector(int size)
size
- the specified size of the fast vectorpublic void reverse()
public boolean contains(long v)
public void add(long v)
v
- the object to be addedpublic void addArray(long[] v)
v
- the objects to be addedpublic void add(int index, long v)
index
- the speciefied indexv
- the object to be addedpublic int remove(long v)
v
- the object to be removedpublic long[] toArray()
public long removeAt(int index)
index
- the specified index of the object to be removepublic int indexOf(long v)
v
- the specified objectpublic void toArray(long[] 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 long 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