etomica.atom
Class AtomArrayList

java.lang.Object
  extended by etomica.atom.AtomArrayList
All Implemented Interfaces:
IAtomList

public class AtomArrayList
extends Object
implements IAtomList


Field Summary
protected  IAtom[] atomList
           
protected static int DEFAULT_INIT_SIZE
           
protected  int itemsInList
           
protected static float SIZE_INCREASE_RATIO
           
protected  float trimThreshold
           
 
Constructor Summary
AtomArrayList()
           
AtomArrayList(int initialSize)
           
 
Method Summary
 boolean add(IAtom atom)
           
 void addAll(IAtomList atoms)
           
 void clear()
           
 void ensureCapacity(int minCapacity)
           
 IAtom getAtom(int index)
          Returns the i-th atom, with numbering beginning from 0.
 int getAtomCount()
           
static float getSizeIncreaseRatio()
           
 float getTrimThreshold()
           
 int indexOf(IAtom elem)
           
 boolean isEmpty()
           
 void maybeTrimToSize()
           
 IAtom remove(int index)
           
 IAtom removeAndReplace(int index)
           
 IAtom set(int index, IAtom element)
           
 void setTrimThreshold(float newTrimThreshold)
           
 int sizeOfArray()
           
protected  IAtom[] toArray()
           
 IAtom[] toAtomLeafArray()
           
 String toString()
           
 void trimToSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

trimThreshold

protected float trimThreshold

atomList

protected IAtom[] atomList

DEFAULT_INIT_SIZE

protected static int DEFAULT_INIT_SIZE

SIZE_INCREASE_RATIO

protected static float SIZE_INCREASE_RATIO

itemsInList

protected int itemsInList
Constructor Detail

AtomArrayList

public AtomArrayList()

AtomArrayList

public AtomArrayList(int initialSize)
Method Detail

getSizeIncreaseRatio

public static float getSizeIncreaseRatio()

trimToSize

public void trimToSize()

maybeTrimToSize

public void maybeTrimToSize()

getTrimThreshold

public float getTrimThreshold()

setTrimThreshold

public void setTrimThreshold(float newTrimThreshold)

ensureCapacity

public void ensureCapacity(int minCapacity)

isEmpty

public boolean isEmpty()

toArray

protected IAtom[] toArray()

clear

public void clear()

sizeOfArray

public int sizeOfArray()

indexOf

public int indexOf(IAtom elem)

toAtomLeafArray

public IAtom[] toAtomLeafArray()

set

public IAtom set(int index,
                 IAtom element)

add

public boolean add(IAtom atom)

addAll

public void addAll(IAtomList atoms)

remove

public IAtom remove(int index)

removeAndReplace

public IAtom removeAndReplace(int index)

getAtomCount

public int getAtomCount()
Specified by:
getAtomCount in interface IAtomList
Returns:
the number of atoms in the set

getAtom

public IAtom getAtom(int index)
Description copied from interface: IAtomList
Returns the i-th atom, with numbering beginning from 0. If i is greater than count-1, throws an IllegalArgumentException.

Specified by:
getAtom in interface IAtomList

toString

public String toString()
Overrides:
toString in class Object