com.sun.j3d.internal
Class FastVector

java.lang.Object
  extended by com.sun.j3d.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.


Field Summary
private  int capacity
           
private  int[] data
           
private  int increment
           
private  int size
           
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private int[] data

capacity

private int capacity

increment

private int increment

size

private int size
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



Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.