|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for environment objects used during copy operations. JGoCopyEnvironment is an interface based on Map.
An object supporting JGoCopyEnvironment is used during copy operations to allow copying complex networks of objects to be handled flexibly. Override JGoObject.copyObject to customize how individual classes of objects get copied.
For example, when a network of objects is copied, references among the objects being copied can be considered to be references to the newly copied object, or references to the original objects, or references to already existing objects.
Some objects may not want to be copied immediately, but only after other objects have been copied-- this is supported by keeping track of delayed objects. This produces a two-pass copying operation: the delayed objects are processed after the initial pass of copying.
JGoObject.copyObject(com.nwoods.jgo.JGoCopyEnvironment)
Nested Class Summary |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Method Summary | |
void |
clearDelayeds()
Removes all delayed objects. |
JGoObject |
copy(JGoObject obj)
Get a new object corresponding to the argument, either by finding an already copied object for it or by calling JGoObject.copyObject. |
JGoObject |
copyComplete(JGoObject obj)
This convenience method performs both copy phases making a copy of a single object. |
void |
delay(java.lang.Object key)
Adds the object to the collection of delayed objects. |
void |
finishDelayedCopies()
Perform calls to JGoObject.copyObjectDelayed for any objects that were added to the Delayeds collection during earlier calls to copy(JGoObject). |
java.util.Vector |
getDelayeds()
Returns the Vector of objects whose copy operation has been delayed. |
boolean |
isDelayed(java.lang.Object key)
Tests if the specified object is in this collection of delayed objects. |
boolean |
isEmptyDelayeds()
Returns true if there are no delayed objects. |
void |
removeDelayed(java.lang.Object key)
Remove the object from the collection of delayed objects. |
int |
sizeDelayeds()
Returns the number of delayed objects. |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
public JGoObject copy(JGoObject obj)
This is a convenience method for JGoObject.copyObject implementations
to call to find the corresponding new object for an old object even when it
has already been copied:
newobj.myObjRef = env.copy(myObjRef);
If the given object is null, this method returns null.
public JGoObject copyComplete(JGoObject obj)
This returns null if the argument is null. Otherwise this returns the result of copy(JGoObject) after a call to finishDelayedCopies().
public void finishDelayedCopies()
This is primarily called by JGoDocument.copyFromCollection.
public void clearDelayeds()
public boolean isEmptyDelayeds()
true
if there are no delayed objects.
public int sizeDelayeds()
public boolean isDelayed(java.lang.Object key)
key
- an object.
true
if the object is considered delayed.public void delay(java.lang.Object key)
key
- the object to be delayedpublic void removeDelayed(java.lang.Object key)
key
- element to be removed from this Vector, if present.
public java.util.Vector getDelayeds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |