|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.miv.pherd.ParticleBox
public class ParticleBox
Container, handler, and animator for the particles.
| Field Summary | |
|---|---|
protected ArrayList<ParticleBoxListener> |
listeners
Set of listeners. |
protected HashMap<Object,Particle> |
particles
The list of particles. |
protected int |
time
Current step. |
protected NTree |
tree
The n-tree. |
| Constructor Summary | |
|---|---|
ParticleBox(int pmax,
CellSpace universe,
CellData rootData)
New particle box. |
|
| Method Summary | |
|---|---|
void |
addParticle(Particle particle)
Add a particle to the list of active particles. |
void |
addParticleBoxListener(ParticleBoxListener listener)
Add a listener for all events coming from the particle box: when a particle is added, removed or moved and for each time step. |
NTree |
getNTree()
The internal space representation, a n-tree. |
Particle |
getParticle(Object id)
Access to a particle. |
int |
getParticleCount()
Number of particles in the box. |
Iterator<Object> |
getParticleIdIterator()
Iterator on the set of particles identifiers. |
void |
removeAllParticles()
Remove all particles of this box. |
Particle |
removeParticle(Object id)
Remove the particle identifier by the given identifier. |
void |
removeParticleBoxListener(ParticleBoxListener listener)
Remove a listener from the particle box. |
void |
step()
One step of the particle simulation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashMap<Object,Particle> particles
protected NTree tree
protected ArrayList<ParticleBoxListener> listeners
protected int time
| Constructor Detail |
|---|
public ParticleBox(int pmax,
CellSpace universe,
CellData rootData)
pmax - The maximum number of particles per cell before a subdivision
occurs.universe - The specific space defining the initial root node.rootData - The data specific to the particle simulation.| Method Detail |
|---|
public Particle getParticle(Object id)
id - The particle unique identifier.public NTree getNTree()
public int getParticleCount()
public Iterator<Object> getParticleIdIterator()
public void addParticle(Particle particle)
throws IdAlreadyInUseException
particle - The new particle.
IdAlreadyInUseException - If a particle with the same identifier that
is not the same particle is added.public Particle removeParticle(Object id)
id - The particle unique identifier.
public void removeAllParticles()
public void step()
public void addParticleBoxListener(ParticleBoxListener listener)
listener - The listener to add.public void removeParticleBoxListener(ParticleBoxListener listener)
listener - The listener to remove.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||