|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.crwth.systems.Space
|
+--org.crwth.systems.UniqueSpace
A generic Space container. Space holds Masses and Springs. Collectors add objects to a Space,
Physics changes them, and Viewers observe.
| Field Summary | |
protected Set |
masses
|
protected Mass |
r
|
protected Set |
springs
|
| Constructor Summary | |
UniqueSpace()
|
|
UniqueSpace(Mass root)
|
|
| Method Summary | |
void |
add(Object object)
Adds an Object to Space. |
void |
addMass(Mass mass)
Adds a Mass to Space. |
void |
addSpring(Spring spring)
Adds a Spring to Space. |
int |
getDimension()
Returns the dimension of the Space. |
Mass |
getMass(String name)
Retrieves a Mass from Space based on the Mass's name. |
Iterator |
getMassIterator()
Returns a Set of the Masses in the Space. |
Mass |
getRoot()
Returns the Mass that is the root of the Space, if any. |
Spring |
getSpring(String name)
Retrieves a Spring from Space based on the Spring's name. |
Iterator |
getSpringIterator()
Returns a Set for the Springs in the Space. |
void |
setRoot(Mass mass)
Sets the root object in the Space. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Set masses
protected Set springs
protected Mass r
| Constructor Detail |
public UniqueSpace()
public UniqueSpace(Mass root)
| Method Detail |
public void add(Object object)
add in class Spaceobject - the Object to add.public void addMass(Mass mass)
addMass in class Spacemass - the Mass to add.public Mass getMass(String name)
getMass in class Spacename - the Mass's name.
name,
or null if none exists.public Iterator getMassIterator()
Collectors or Physics.
getMassIterator in class Spacepublic void addSpring(Spring spring)
addSpring in class Spacespring - the Spring to add.public Spring getSpring(String name)
getSpring in class Spacename - the Spring's name.
name,
or null if none exists.public Iterator getSpringIterator()
Collectors or Physics.
getSpringIterator in class Spacepublic void setRoot(Mass mass)
setRoot in class Spacemass - the Mass to set as the root.public Mass getRoot()
getRoot in class Spacenull if not.public int getDimension()
getDimension in class Spacepublic String toString()
toString in class Space
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||