etomica.api
Interface IBox

All Known Implementing Classes:
Box

public interface IBox


Method Summary
 void addMolecule(IMolecule molecule)
          Adds the given molecule to the this box.
 void addSpeciesNotify(ISpecies species)
          Notifies the IBox that the given species has been added to the simulation.
 IBoundary getBoundary()
          Returns the box's boundary.
 IBoxEventManager getEventManager()
          Returns the event manager for this box.
 int getIndex()
          Returns the IBox's index.
 IAtomList getLeafList()
          Returns the list of atoms contained in this box.
 IMoleculeList getMoleculeList()
          Returns a list of all molecules in this box as an IAtomSet.
 IMoleculeList getMoleculeList(ISpecies species)
          Returns the list of molecules of the given species as an IAtomSet that are in this box.
 int getNMolecules(ISpecies species)
          Returns the number of molecules in this box of the given ISpecies.
 void removeMolecule(IMolecule molecule)
          Removes the given molecule from this box.
 void removeSpeciesNotify(ISpecies species)
          Notifies the IBox that a Species has been removed.
 void setBoundary(IBoundary newBoundary)
          Sets the box's boundary to the given IBoundary.
 void setIndex(int newIndex)
          Informs the IBox what its index is.
 void setNMolecules(ISpecies species, int n)
          Sets the number of molecules in this box of the given ISpecies to n.
 

Method Detail

setIndex

void setIndex(int newIndex)
Informs the IBox what its index is. This should only be called by the ISimulation.


getIndex

int getIndex()
Returns the IBox's index. The index corresponds to the box's position in the simulation's list of IBoxes. The index of the first IBox is 0. The index of the last IBox is n-1, where n is the number of IBoxes.


addMolecule

void addMolecule(IMolecule molecule)
Adds the given molecule to the this box. The molecule should not already be in this box and should not be in another IBox. The molecule should be a member of an ISpecies which has been added to the ISimulation.


removeMolecule

void removeMolecule(IMolecule molecule)
Removes the given molecule from this box. The molecule must be held by the box before this method is called.


setNMolecules

void setNMolecules(ISpecies species,
                   int n)
Sets the number of molecules in this box of the given ISpecies to n. Molecules are added to or removed from the box to achieve the desired number.


getNMolecules

int getNMolecules(ISpecies species)
Returns the number of molecules in this box of the given ISpecies.


getMoleculeList

IMoleculeList getMoleculeList(ISpecies species)
Returns the list of molecules of the given species as an IAtomSet that are in this box.


getMoleculeList

IMoleculeList getMoleculeList()
Returns a list of all molecules in this box as an IAtomSet.


getLeafList

IAtomList getLeafList()
Returns the list of atoms contained in this box.


setBoundary

void setBoundary(IBoundary newBoundary)
Sets the box's boundary to the given IBoundary.


getBoundary

IBoundary getBoundary()
Returns the box's boundary.


getEventManager

IBoxEventManager getEventManager()
Returns the event manager for this box.

Returns:

addSpeciesNotify

void addSpeciesNotify(ISpecies species)
Notifies the IBox that the given species has been added to the simulation. This method should only be called by the simulation.


removeSpeciesNotify

void removeSpeciesNotify(ISpecies species)
Notifies the IBox that a Species has been removed. This method should only be called by the simulation. This triggers the removal of all molecules of the given species from this box.