Package com.kheops.util
Class FastVector
java.lang.Object
com.kheops.util.FastVector
This class is a simpler implementation of a growable array than the Vector class
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a fast vector with the default size.FastVector(int size) Constructs an fast vector instance with the specified sizeFastVector(Object[] array) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds an element at the specified indexvoidAdds an element to the fast vectorvoidAdds elements to the fast vectorvoidclear()This method empties the fast vectorbooleanelementAt(int index) Gets the object at the specified indexelements()This method returns an enumeration from the fast vectorget(int index) Gets the object at the specified indexintGets 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) remove(int index) Removes the object at the specified index from the fast vectorRemoves the specified object from the fast vectorvoidreverse()voidintsize()Gets the size of the fast vectorObject[]toArray()Return all elements contained in this Vector in an array.voidThis method copies the element of the vectors to a specified arraytoString()
- 
Field Details- 
elements
- 
elementCountprotected int elementCount
 
- 
- 
Constructor Details- 
FastVectorpublic FastVector()Constructs a fast vector with the default size.
- 
FastVector
- 
FastVectorpublic FastVector(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()
- 
contains
- 
addAdds an element to the fast vector- Parameters:
- o- the object to be added
 
- 
addArrayAdds elements to the fast vector- Parameters:
- o- the objects to be added
 
- 
addAdds an element at the specified index- Parameters:
- index- the speciefied index
- o- the object to be added
 
- 
removeRemoves the specified object from the fast vector- Parameters:
- o- the object to be removed
- Returns:
- ret a reference to the object removed
 
- 
toArrayReturn all elements contained in this Vector in an array.
- 
removeRemoves 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
 
- 
indexOfGets the index of the specified object- Parameters:
- o- the specified object
- Returns:
- index the position of the object
 
- 
toArrayThis 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
 
- 
getGets the object at the specified index- Parameters:
- index- the specified index
- Returns:
- the object at the index position.
 
- 
set
- 
elementAtGets 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
 
-