|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ParticleList
public class ParticleList
A collection class that can only hold Particle objects. Particle can be added or removed. They can be accessed and the number of particles can be requested. Removing Particles is not garanteed to be stable--that is, the order before and after may be different.
Constructor Summary | |
---|---|
ParticleList()
Create a new, initially empty, ParticleList |
Method Summary | |
---|---|
void |
add(Particle toAdd)
Add the given Particle to the list |
Particle |
get(int index)
Get the Particle at the specified index. |
boolean |
isEmpty()
Returns true if the list has no Particles |
boolean |
isValidIndex(int index)
Returns true if the suppled index is valid for this ParticleList |
void |
remove(int index)
Remove the Particle at the specified index. |
int |
size()
Get's the number of Particles in this list. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParticleList()
Method Detail |
---|
public Particle get(int index)
index
- The index of the desired Particle
public void add(Particle toAdd)
toAdd
- The Particle to addpublic void remove(int index)
index
- The index of the Particle to removepublic boolean isValidIndex(int index)
index
- The index to check
public boolean isEmpty()
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |