|
||||||||||
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.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
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 called to test if a node that is referenced by the object has been duplicated in the new cloned sub-graph. |
java.util.Iterator |
iterator()
Return an iterator for this table. |
void |
reset()
Resets the table, removing all entries from it. |
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 java.util.Iterator iterator()
public ZSceneGraphObject getNewObjectReference(ZSceneGraphObject origObj)
origObj
- The reference to the object in the original sub-graph.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |