Package com.kheops.util
Class LongVector
java.lang.Object
com.kheops.util.LongVector
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a int vector with the default size.LongVector(int size) Constructs an fast vector instance with the specified sizeLongVector(long[] array) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(int index, long v) Adds an element at the specified indexvoidadd(long v) Adds an element to the fast vectorvoidaddArray(long[] v) Adds elements to the fast vectorvoidclear()This method empties the fast vectorbooleancontains(long v) longelementAt(int index) Gets the object at the specified indexelements()This method returns an enumeration from the fast vectorintindexOf(long v) Gets the index of the specified objectThis method returns an enumeration from the fast vector This enumeration travels in the reverse order.voidmoveElement(int indexSrc, int indexDest) intremove(long v) Removes the specified object from the vectorlongremoveAt(int index) Removes the object at the specified index from the fast vectorvoidreverse()intsize()Gets the size of the fast vectorlong[]toArray()Return all elements contained in this Vector in an array.voidtoArray(long[] targetArray) This method copies the element of the vectors to a specified arraytoString()
- 
Field Details- 
elementsprotected long[] elements
- 
elementCountprotected int elementCount
 
- 
- 
Constructor Details- 
LongVectorpublic LongVector()Constructs a int vector with the default size.
- 
LongVectorpublic LongVector(long[] array) 
- 
LongVectorpublic LongVector(int size) Constructs an fast vector instance with the specified size- Parameters:
- size- the specified size of the fast vector
 
 
- 
- 
Method Details- 
reversepublic void reverse()
- 
containspublic boolean contains(long v) 
- 
addpublic void add(long v) Adds an element to the fast vector- Parameters:
- v- the object to be added
 
- 
addArraypublic void addArray(long[] v) Adds elements to the fast vector- Parameters:
- v- the objects to be added
 
- 
addpublic void add(int index, long v) Adds an element at the specified index- Parameters:
- index- the speciefied index
- v- the object to be added
 
- 
removepublic int remove(long v) Removes the specified object from the vector- Parameters:
- v- the object to be removed
- Returns:
- ret a reference to the object removed
 
- 
toArraypublic long[] toArray()Return all elements contained in this Vector in an array.
- 
removeAtpublic long removeAt(int index) Removes the object at the specified index from the fast vector- Parameters:
- index- the specified index of the object to be remove
- Returns:
- ret the reference to the object removed
 
- 
indexOfpublic int indexOf(long v) Gets the index of the specified object- Parameters:
- v- the specified object
- Returns:
- index the position of the object
 
- 
toArraypublic void toArray(long[] targetArray) This method copies the element of the vectors to a specified array- Parameters:
- targetArray- the array in which the elements of the fast vector will be copied in
 
- 
sizepublic int size()Gets the size of the fast vector- Returns:
- the number of elements the stored in the fast vector
 
- 
elementsThis method returns an enumeration from the fast vector- Returns:
- elements the resulting enumeration
 
- 
inversedElementsThis method returns an enumeration from the fast vector This enumeration travels in the reverse order.- Returns:
- elements the resulting enumeration
 
- 
elementAtpublic long elementAt(int index) Gets the object at the specified index- Parameters:
- index- the specified index
- Returns:
- the object at the index position.
 
- 
clearpublic void clear()This method empties the fast vector
- 
moveElementpublic void moveElement(int indexSrc, int indexDest) 
- 
toString
 
-