public class UnifiedUserData extends UserData implements UserDataFactory
n.addUserDatum("3DData", new 3DData (
))
.
Later, to access this information, the call might be 3DData dd =
(3DData) n.getUserDatum("3DData").
UserDataContainer.CopyAction
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map |
key_meta_map |
Constructor and Description |
---|
UnifiedUserData() |
Modifier and Type | Method and Description |
---|---|
void |
addUserDatum(java.lang.Object key,
java.lang.Object value,
UserDataContainer.CopyAction shared)
Adds user-level information to the node.
|
java.lang.Object |
clone() |
boolean |
containsUserDatumKey(java.lang.Object key)
Reports whether
key is a key of this user data container. |
UserDataContainer |
getInstance()
Returns a single
UserDataContainer instance. |
protected java.util.Map |
getKeyMap(java.lang.Object key) |
java.lang.Object |
getUserDatum(java.lang.Object key)
Returns UserData (if any) for this key, or null if not
known.
|
UserDataContainer.CopyAction |
getUserDatumCopyAction(java.lang.Object key)
Returns the CopyAction associated with this key.
|
java.util.Iterator |
getUserDatumKeyIterator()
Returns an
Iterator which can be used to iterate over
all the user data repository keys for this object. |
protected Pair |
getUserDatumValuePair(java.lang.Object key) |
void |
importUserData(UserDataContainer udc)
Uses the CopyAction to determine how each of the user datum elements in
udc should be carried over to the this UserDataContiner
|
java.lang.Object |
removeUserDatum(java.lang.Object key)
Removes the Datum (if any) for this key, and returns it.
|
void |
setUserDatum(java.lang.Object key,
java.lang.Object value,
UserDataContainer.CopyAction shared)
Changes the user-level information to the object.
|
protected java.util.Map getKeyMap(java.lang.Object key)
public void addUserDatum(java.lang.Object key, java.lang.Object value, UserDataContainer.CopyAction shared)
addUserDatum
in interface UserDataContainer
key
- A unique (per type, not per node) key into the informationvalue
- The extended information associated with the nodeshared
- the CopyAction of the datum being addedpublic void importUserData(UserDataContainer udc)
importUserData
in interface UserDataContainer
udc
- The UserDataContainer whose user data is being importedpublic void setUserDatum(java.lang.Object key, java.lang.Object value, UserDataContainer.CopyAction shared)
removeUserDatum( key ); addUserDatum(key, value)
setUserDatum
in interface UserDataContainer
key
- value
- shared
- the CopyAction for the new (key, datum) pairpublic java.lang.Object getUserDatum(java.lang.Object key)
getUserDatum
in interface UserDataContainer
key
- protected Pair getUserDatumValuePair(java.lang.Object key)
public java.lang.Object removeUserDatum(java.lang.Object key)
removeUserDatum
in interface UserDataContainer
key
- public java.util.Iterator getUserDatumKeyIterator()
Iterator
which can be used to iterate over
all the user data repository keys for this object.getUserDatumKeyIterator
in interface UserDataContainer
public boolean containsUserDatumKey(java.lang.Object key)
UserDataContainer
key
is a key of this user data container.containsUserDatumKey
in interface UserDataContainer
key
- the key to be queriedkey
is present in this user data containerUserDataContainer.containsUserDatumKey(Object)
public UserDataContainer.CopyAction getUserDatumCopyAction(java.lang.Object key)
getUserDatumCopyAction
in interface UserDataContainer
key
- public UserDataContainer getInstance()
UserDataFactory
UserDataContainer
instance.
Depending on the architecture involved, this may be a singleton
instance, or a new instance may be generated each time the
method is called.getInstance
in interface UserDataFactory
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface UserDataContainer
clone
in class UserData
java.lang.CloneNotSupportedException