|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nwoods.jgo.JGoCopyMap
The default environment object used during copy operations. JGoCopyMap is used during copy operations to allow copies of complex networks of objects to be handled flexibly.
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. JGoCopyMap copies all objects and maintains interobject references in a manner similar to how the original collection of objects referred to each other.
JGoObject.copyObject(com.nwoods.jgo.JGoCopyEnvironment),
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Constructor Summary | |
JGoCopyMap()
Constructs a new JGoCopyMap, which is basically a HashMap along with a Vector holding objects whose copying has been delayed. |
|
| Method Summary | |
void |
clear()
The standard Map behavior |
void |
clearDelayeds()
Removes all delayed objects. |
boolean |
containsKey(java.lang.Object key)
The standard Map behavior |
boolean |
containsValue(java.lang.Object value)
The standard Map behavior |
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. |
java.util.Set |
entrySet()
The standard Map behavior |
boolean |
equals(java.lang.Object o)
The standard Map behavior |
void |
finishDelayedCopies()
Perform calls to JGoObject.copyObjectDelayed for any objects that were added to the Delayeds collection during earlier calls to copy(JGoObject). |
java.lang.Object |
get(java.lang.Object key)
The standard Map behavior |
java.util.Vector |
getDelayeds()
Returns the Vector of objects whose copy operation has been delayed. |
int |
hashCode()
The standard Map behavior |
boolean |
isDelayed(java.lang.Object key)
Tests if the specified object is in this collection of delayed objects. |
boolean |
isEmpty()
The standard Map behavior |
boolean |
isEmptyDelayeds()
Returns true if there are no delayed objects. |
java.util.Set |
keySet()
The standard Map behavior |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
The standard Map behavior |
void |
putAll(java.util.Map t)
The standard Map behavior |
java.lang.Object |
remove(java.lang.Object key)
The standard Map behavior |
void |
removeDelayed(java.lang.Object key)
Remove the object from the collection of delayed objects. |
int |
size()
The standard Map behavior |
int |
sizeDelayeds()
Returns the number of delayed objects. |
java.util.Collection |
values()
The standard Map behavior |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JGoCopyMap()
| Method Detail |
public void clear()
clear in interface java.util.Mappublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mappublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mappublic boolean equals(java.lang.Object o)
equals in interface java.util.Mappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mappublic int hashCode()
hashCode in interface java.util.Mappublic boolean isEmpty()
isEmpty in interface java.util.Mappublic java.util.Set keySet()
keySet in interface java.util.Map
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mappublic void putAll(java.util.Map t)
putAll in interface java.util.Mappublic java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mappublic int size()
size in interface java.util.Mappublic java.util.Collection values()
values in interface java.util.Mappublic JGoObject copy(JGoObject obj)
JGoCopyEnvironment
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.
copy in interface JGoCopyEnvironmentpublic void finishDelayedCopies()
This is primarily called by JGoDocument.copyFromCollection.
finishDelayedCopies in interface JGoCopyEnvironmentpublic JGoObject copyComplete(JGoObject obj)
copyComplete in interface JGoCopyEnvironmentpublic void clearDelayeds()
JGoCopyEnvironment
clearDelayeds in interface JGoCopyEnvironmentpublic boolean isEmptyDelayeds()
JGoCopyEnvironmenttrue if there are no delayed objects.
isEmptyDelayeds in interface JGoCopyEnvironmentpublic int sizeDelayeds()
JGoCopyEnvironment
sizeDelayeds in interface JGoCopyEnvironmentpublic boolean isDelayed(java.lang.Object key)
JGoCopyEnvironment
isDelayed in interface JGoCopyEnvironmentkey - an object.
true if the object is considered delayed.public void delay(java.lang.Object key)
JGoCopyEnvironment
delay in interface JGoCopyEnvironmentkey - the object to be delayedpublic void removeDelayed(java.lang.Object key)
JGoCopyEnvironment
removeDelayed in interface JGoCopyEnvironmentkey - element to be removed from this Vector, if present.
public java.util.Vector getDelayeds()
JGoCopyEnvironment
getDelayeds in interface JGoCopyEnvironment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||