etomica.nbr.list
Class AtomNeighborLists

java.lang.Object
  extended by etomica.nbr.list.AtomNeighborLists
All Implemented Interfaces:
Serializable

public class AtomNeighborLists
extends Object
implements Serializable

Class used to maintain neighbor lists. Holds lists of atoms that were elsewhere deemed to be neighbors of the another atom. A separate AtomArrayList is kept for each potential (potential => AtomArrayList mapping is the responsibility of the consumer).

See Also:
Serialized Form

Field Summary
protected  AtomArrayList[] downList
           
protected  AtomArrayList[] upList
           
 
Constructor Summary
AtomNeighborLists()
          Constructs sequencer for the given atom.
 
Method Summary
 void addDownNbr(IAtom a, int index)
          Adds the given atom as a "down" neighbor interacting via the potential with the given index.
 void addUpNbr(IAtom a, int index)
          Adds the given atom as a "down" neighbor interacting via the potential with the given index.
 void clearNbrs()
          Clears neighbor lists, removing all listed neighbor atoms.
 IAtomList[] getDownList()
          Returns an array of downlist-neighbor-atom lists.
 IAtomList[] getUpList()
          Returns an array of uplist-neighbor-atom lists.
protected  void setCapacity(int newCapacity)
          Sets the number of up and down lists maintained by this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

upList

protected AtomArrayList[] upList

downList

protected AtomArrayList[] downList
Constructor Detail

AtomNeighborLists

public AtomNeighborLists()
Constructs sequencer for the given atom.

Method Detail

addUpNbr

public void addUpNbr(IAtom a,
                     int index)
Adds the given atom as a "down" neighbor interacting via the potential with the given index.

Parameters:
a - the new downlist neighbor atom
index - the of the potential between the atoms

addDownNbr

public void addDownNbr(IAtom a,
                       int index)
Adds the given atom as a "down" neighbor interacting via the potential with the given index.

Parameters:
a - the new downlist neighbor atom
index - the of the potential between the atoms

getUpList

public IAtomList[] getUpList()
Returns an array of uplist-neighbor-atom lists. Each list in the array corresponds to a specific potential. A zero-length list indicates that no concrete potentials apply to the atom.


getDownList

public IAtomList[] getDownList()
Returns an array of downlist-neighbor-atom lists. Each list in the array corresponds to a specific potential. A zero-length list indicates that no concrete potentials apply to the atom.


setCapacity

protected void setCapacity(int newCapacity)
Sets the number of up and down lists maintained by this instance.


clearNbrs

public void clearNbrs()
Clears neighbor lists, removing all listed neighbor atoms.