JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class GrowOnlyArray

java.lang.Object
  extended bygov.nasa.alsUtility.GrowOnlyArray
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UpdateAndPropagateList

public class GrowOnlyArray
extends java.lang.Object
implements java.io.Serializable

growing list of objects that will never need the garbage collector (for speed)

See Also:
Serialized Form

Field Summary
protected  java.lang.Object[] array
           
protected  int currentSize
           
static int DEFAULT_GROWBY
           
static int DEFAULT_INITIAL_SIZE
           
protected  int growBy
           
 
Constructor Summary
GrowOnlyArray()
           
GrowOnlyArray(int inInitialSize, int inGrowBy)
           
 
Method Summary
 void add(java.lang.Object o)
           
 java.lang.Object get(int i)
           
protected  void grow()
           
 void reinitialize()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INITIAL_SIZE

public static final int DEFAULT_INITIAL_SIZE
See Also:
Constant Field Values

DEFAULT_GROWBY

public static final int DEFAULT_GROWBY
See Also:
Constant Field Values

growBy

protected int growBy

array

protected java.lang.Object[] array

currentSize

protected int currentSize
Constructor Detail

GrowOnlyArray

public GrowOnlyArray()

GrowOnlyArray

public GrowOnlyArray(int inInitialSize,
                     int inGrowBy)
Method Detail

size

public int size()

reinitialize

public void reinitialize()

add

public void add(java.lang.Object o)

get

public java.lang.Object get(int i)

grow

protected void grow()

JavaGenes, NASA Ames. Written largely by Al Globus