javax.media.ding3d.internal
Class FastVector

java.lang.Object
  extended by javax.media.ding3d.internal.FastVector

public class FastVector
extends java.lang.Object

The FastVector object is a growable array of ints. It's much faster than the Java Vector class because it isn't synchronized. This class was created because it is needed in several places by graphics utilities.


Constructor Summary
FastVector()
          Constructor.
FastVector(int initialCapacity)
          Constructor.
FastVector(int initialCapacity, int capacityIncrement)
          Constructor.
 
Method Summary
 void addElement(int element)
          Add an element to the end of the array.
 int[] getData()
          Get access to array data
 int getSize()
          Get number of ints currently stored in the array;
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastVector

public FastVector(int initialCapacity,
                  int capacityIncrement)
Constructor.

Parameters:
initialCapacity - Number of ints the object can hold without reallocating the array.
capacityIncrement - Once the array has grown beyond its capacity, how much larger the reallocated array should be.

FastVector

public FastVector(int initialCapacity)
Constructor. When the array runs out of space, its size is doubled.

Parameters:
initialCapacity - Number of ints the object can hold without reallocating the array.

FastVector

public FastVector()
Constructor. The array is constructed with initial capacity of one integer. When the array runs out of space, its size is doubled.

Method Detail

addElement

public void addElement(int element)
Add an element to the end of the array.


getSize

public int getSize()
Get number of ints currently stored in the array;


getData

public int[] getData()
Get access to array data