Class FastVector

java.lang.Object
com.kheops.util.FastVector

public class FastVector extends Object
This class is a simpler implementation of a growable array than the Vector class
  • Field Details

    • elements

      protected Object[] elements
    • elementCount

      protected int elementCount
  • Constructor Details

    • FastVector

      public FastVector()
      Constructs a fast vector with the default size.
    • FastVector

      public FastVector(Object[] array)
    • FastVector

      public FastVector(int size)
      Constructs an fast vector instance with the specified size
      Parameters:
      size - the specified size of the fast vector
  • Method Details

    • reverse

      public void reverse()
    • contains

      public boolean contains(Object o)
    • add

      public void add(Object o)
      Adds an element to the fast vector
      Parameters:
      o - the object to be added
    • addArray

      public void addArray(Object[] o)
      Adds elements to the fast vector
      Parameters:
      o - the objects to be added
    • add

      public void add(int index, Object o)
      Adds an element at the specified index
      Parameters:
      index - the speciefied index
      o - the object to be added
    • remove

      public Object remove(Object o)
      Removes the specified object from the fast vector
      Parameters:
      o - the object to be removed
      Returns:
      ret a reference to the object removed
    • toArray

      public Object[] toArray()
      Return all elements contained in this Vector in an array.
    • remove

      public Object remove(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
    • indexOf

      public int indexOf(Object o)
      Gets the index of the specified object
      Parameters:
      o - the specified object
      Returns:
      index the position of the object
    • toArray

      public void toArray(Object[] 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
    • size

      public int size()
      Gets the size of the fast vector
      Returns:
      the number of elements the stored in the fast vector
    • elements

      public Enumeration elements()
      This method returns an enumeration from the fast vector
      Returns:
      elements the resulting enumeration
    • inversedElements

      public Enumeration inversedElements()
      This method returns an enumeration from the fast vector This enumeration travels in the reverse order.
      Returns:
      elements the resulting enumeration
    • get

      public Object get(int index)
      Gets the object at the specified index
      Parameters:
      index - the specified index
      Returns:
      the object at the index position.
    • set

      public void set(int index, Object o)
    • elementAt

      public Object elementAt(int index)
      Gets the object at the specified index
      Parameters:
      index - the specified index
      Returns:
      the object at the index position.
    • clear

      public void clear()
      This method empties the fast vector
    • moveElement

      public void moveElement(int indexSrc, int indexDest)
    • toString

      public String toString()
      Overrides:
      toString in class Object