BoxCluster
public class Box
extends java.lang.Object
Simulation.addBox(Box)
and
may be accessed via the simulation's getBox method.Boundary
,
BoxEventManager
Modifier and Type | Field | Description |
---|---|---|
protected AtomSetAllMolecules |
allMoleculeList |
|
protected AtomArrayList |
leafList |
List of leaf atoms in box
|
protected MoleculeArrayList[] |
moleculeLists |
Constructor | Description |
---|---|
Box(Boundary boundary,
Space space) |
Constructs box with the given Boundary, which specifies the size and shape of the Box and specifies what
happens to atoms as they cross the box boundary e.g.
|
Box(Space space) |
Constructs box with default rectangular periodic boundary.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addMolecule(IMolecule molecule) |
Adds the given molecule to the this Box.
|
IMolecule |
addNewMolecule(ISpecies species) |
Creates a molecule of the given species and adds it to the box
|
void |
addSpeciesNotify(ISpecies species) |
Notifies the Box that the given species has been added to the
simulation.
|
Boundary |
getBoundary() |
|
BoxEventManager |
getEventManager() |
|
int |
getIndex() |
|
IAtomList |
getLeafList() |
|
IMoleculeList |
getMoleculeList() |
|
IMoleculeList |
getMoleculeList(ISpecies species) |
Returns the list of molecules of the given species.
|
int |
getNMolecules(ISpecies species) |
|
Space |
getSpace() |
|
protected void |
notifyNewMolecules(ISpecies species,
int numNewMolecules,
int moleculeLeafAtoms) |
|
void |
removeMolecule(IMolecule molecule) |
Removes the given molecule from this Box.
|
void |
removeSpeciesNotify(ISpecies species) |
Notifies the Box that a Species has been removed.
|
void |
setDensity(double rho) |
Uses BoxInflate to adjust the volume to the specified density.
|
void |
setIndex(int newIndex) |
Informs the Box what its index is.
|
void |
setNMolecules(ISpecies species,
int n) |
Sets the number of molecules in this box of the given Species to n.
|
java.lang.String |
toString() |
protected final AtomArrayList leafList
protected final AtomSetAllMolecules allMoleculeList
protected MoleculeArrayList[] moleculeLists
public Box(Space space)
space
- space governing the simulationpublic Box(Boundary boundary, Space space)
boundary
- the specified Boundaryspace
- space governing the simulationpublic Space getSpace()
public int getIndex()
public void setIndex(int newIndex)
newIndex
- the Box's new indexpublic java.lang.String toString()
toString
in class java.lang.Object
public IMolecule addNewMolecule(ISpecies species)
species
- the given speciespublic void addMolecule(IMolecule molecule)
molecule
- the molecule to be added to the Boxpublic void removeMolecule(IMolecule molecule)
molecule
- the molecule to be removed from the Boxjava.lang.IllegalArgumentException
- if the given molecule is not in the Boxpublic void setNMolecules(ISpecies species, int n)
species
- the species whose number of molecules should be changedn
- the desired number of moleculesjava.lang.IllegalArgumentException
- if n < 0.public int getNMolecules(ISpecies species)
public IMoleculeList getMoleculeList(ISpecies species)
species
- the speciespublic IMoleculeList getMoleculeList()
public final Boundary getBoundary()
public void setDensity(double rho)
rho
- the specified densitypublic BoxEventManager getEventManager()
public void addSpeciesNotify(ISpecies species)
species
- the added speciespublic void removeSpeciesNotify(ISpecies species)
species
- the removed speciespublic IAtomList getLeafList()
protected void notifyNewMolecules(ISpecies species, int numNewMolecules, int moleculeLeafAtoms)