|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.util.ZObjectReferenceTable
ZObjectReferenceTable helps to manage the references between objects within the scenegraph when a portion of the scenegraph is duplicated with clone(). It maintains the relationship between all cloned objects, and the original objects they were cloned from. Then, after all objects have been duplicated, each object's updateObjectReferences method is called. This method takes a ZObjectReferenceTable object as a parameter. The object's updateObjectReferences method can then use the getNewObjectReference method from this object to get updated references to objects that have been duplicated in the new sub-graph. If a match is found, a reference to the corresponding object in the newly cloned sub-graph is returned. If no corresponding reference is found, a ZDanglingReferenceException is thrown.
ZObjectReferenceTable is a singleton, which means that there can only be one instance of it in the entire run-time system. Rather than call the constructor, use the getInstance() method to access the single instance.
Constructor Summary | |
protected |
ZObjectReferenceTable()
Constructor for new empty table. |
Method Summary | |
void |
addObject(ZSceneGraphObject orig,
ZSceneGraphObject copy)
Adds an original/cloned object pair to the table. |
static ZObjectReferenceTable |
getInstance()
Implements singleton for this class. |
ZSceneGraphObject |
getNewObjectReference(ZSceneGraphObject origObj)
This method is used in conjunction with the clone() method. |
void |
reset()
Resets the table, removing all entries from it. |
void |
updateObjectReferences()
Goes through all the original objects in the table, and notifies them to update their internal references, passing in a reference to this table so it can be queried for original/new object mappings. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
protected ZObjectReferenceTable()
Method Detail |
public static ZObjectReferenceTable getInstance()
public void addObject(ZSceneGraphObject orig, ZSceneGraphObject copy)
orig
- The original objectcopy
- The copy of the original objectpublic void reset()
public void updateObjectReferences()
public ZSceneGraphObject getNewObjectReference(ZSceneGraphObject origObj) throws ZDanglingReferenceException
origObj
- The reference to the object in the original sub-graph.
|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |