-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Comparable,java.lang.Iterable
public interface Node<T> implements Serializable, Iterable<Reaction<T>>, Comparable<Node<T>>
-
-
Method Summary
Modifier and Type Method Description abstract voidaddReaction(Reaction<T> r)Adds a reaction to this node. abstract Node<T>cloneNode(Time currentTime)Creates a new Node which is a clone of the current Node. abstract booleancontains(Molecule mol)Tests whether a node contains a Molecule. abstract TgetConcentration(Molecule mol)Calculates the concentration of a molecule. abstract Map<Molecule, T>getContents()abstract intgetId()abstract intgetMoleculeCount()abstract List<Reaction<T>>getReactions()This method allows to access all the reaction of the node. abstract inthashCode()abstract voidremoveConcentration(Molecule mol)abstract voidremoveReaction(Reaction<T> r)Removes a reaction from this node. abstract voidsetConcentration(Molecule mol, T c)Sets the concentration of mol to c. -
-
Method Detail
-
addReaction
abstract void addReaction(Reaction<T> r)
Adds a reaction to this node. The reaction is added only in the node, but not in the Simulation scheduler, so it will never be executed. To add the reaction also in the scheduler (and start to execute it), you have to call also the method reactionAdded.
- Parameters:
r- the reaction to be added
-
cloneNode
abstract Node<T> cloneNode(Time currentTime)
Creates a new Node which is a clone of the current Node. The new Node will have all the current Node's properties, such as reactions and molecules, but it will also have a different ID.
- Parameters:
currentTime- the time at which the cloning operation happens
-
contains
abstract boolean contains(Molecule mol)
Tests whether a node contains a Molecule.
- Parameters:
mol- the molecule to check
-
getConcentration
abstract T getConcentration(Molecule mol)
Calculates the concentration of a molecule.
- Parameters:
mol- the molecule whose concentration will be returned
-
getContents
abstract Map<Molecule, T> getContents()
-
getId
abstract int getId()
-
getMoleculeCount
abstract int getMoleculeCount()
-
getReactions
abstract List<Reaction<T>> getReactions()
This method allows to access all the reaction of the node.
-
hashCode
abstract int hashCode()
-
removeConcentration
abstract void removeConcentration(Molecule mol)
- Parameters:
mol- the molecule that should be removed
-
removeReaction
abstract void removeReaction(Reaction<T> r)
Removes a reaction from this node. The reaction is removed only in the node, but not in the Simulation scheduler, so the scheduler will continue to execute the reaction. To remove the reaction also in the scheduler (and stop to execute it), you have to call also the method reactionRemoved.
- Parameters:
r- the reaction to be removed
-
setConcentration
abstract void setConcentration(Molecule mol, T c)
Sets the concentration of mol to c.
- Parameters:
mol- the molecule you want to set the concentrationc- the concentration you want for mol
-
-
-
-