etomica.atom
Class AtomArrayList
java.lang.Object
etomica.atom.AtomArrayList
- All Implemented Interfaces:
- IAtomList
public class AtomArrayList
- extends Object
- implements IAtomList
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
AtomArrayList
public AtomArrayList()
AtomArrayList
public AtomArrayList(int initialSize)
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