T - public class AtomsArrayList<T extends java.lang.Comparable<T>> extends java.lang.Object implements IAtomsCollection<T>
| Modifier and Type | Field and Description |
|---|---|
private java.util.ArrayList<T> |
atomsArray |
private byte |
process
The "movements" that atom can do.
|
private double |
totalRate |
| Constructor and Description |
|---|
AtomsArrayList(byte process)
Array List implementation for atom collection storing.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
add(T atom) |
void |
addRate(T atom)
Current atom is added.
|
void |
clear()
Used to recompute the collection.
|
double |
getTotalRate(byte process) |
void |
insert(T atom)
Current atom is added.
|
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
void |
populate()
Does nothing.
|
T |
randomElement()
Chooses a random atom or island.
|
void |
recomputeTotalRate(byte process) |
void |
remove(T atom) |
void |
removeAtomRate(T atom)
Removes atom's rate, with its old desorption rate and sets to zero.
|
void |
reset()
Used to empty the collection.
|
T |
search(T atom)
Return an atom with the same atom Id that was given from the list.
|
int |
size() |
void |
updateRate(T atom,
double diff)
Updates total rate.
|
private double totalRate
private final byte process
public AtomsArrayList(byte process)
process - The "movements" that atom can do. For example: Adsorption, desorption, reaction or diffusion.public void insert(T atom)
insert in interface IAtomsCollection<T extends java.lang.Comparable<T>>atom - public void addRate(T atom)
addRate in interface IAtomsCollection<T extends java.lang.Comparable<T>>atom - private void add(T atom)
public void remove(T atom)
remove in interface IAtomsCollection<T extends java.lang.Comparable<T>>public void removeAtomRate(T atom)
IAtomsCollectionremoveAtomRate in interface IAtomsCollection<T extends java.lang.Comparable<T>>public void updateRate(T atom, double diff)
updateRate in interface IAtomsCollection<T extends java.lang.Comparable<T>>atom - Ignored.diff - Value to be added.public void populate()
populate in interface IAtomsCollection<T extends java.lang.Comparable<T>>public void recomputeTotalRate(byte process)
recomputeTotalRate in interface IAtomsCollection<T extends java.lang.Comparable<T>>public double getTotalRate(byte process)
getTotalRate in interface IAtomsCollection<T extends java.lang.Comparable<T>>public void clear()
IAtomsCollectionclear in interface IAtomsCollection<T extends java.lang.Comparable<T>>public void reset()
IAtomsCollectionreset in interface IAtomsCollection<T extends java.lang.Comparable<T>>public T randomElement()
IAtomsCollectionrandomElement in interface IAtomsCollection<T extends java.lang.Comparable<T>>public java.util.Iterator<T> iterator()
iterator in interface IAtomsCollection<T extends java.lang.Comparable<T>>public int size()
size in interface IAtomsCollection<T extends java.lang.Comparable<T>>public boolean isEmpty()
isEmpty in interface IAtomsCollection<T extends java.lang.Comparable<T>>