|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uci.ics.jung.utils.UserData
edu.uci.ics.jung.utils.UnifiedUserData
public class UnifiedUserData
Represents custom user- and system-level information to extend the definition of a node. This is the easiest way to extend the class without subclassing. This works as a dictionary in order to help ensure that there are possibilities for extending user information to a variety of different sorts of data. (Each provider of information can register their own enhanced information without interfering with other providers.) Some suggested uses of UserData include
n.addUserDatum("3DData", new 3DData (
)).
Later, to access this information, the call might be 3DData dd =
(3DData) n.getUserDatum("3DData").
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
|---|
UserDataContainer.CopyAction |
| Field Summary | |
|---|---|
protected static Map |
key_meta_map
|
| Fields inherited from class edu.uci.ics.jung.utils.UserData |
|---|
CLONE, REMOVE, SHARED |
| Constructor Summary | |
|---|---|
UnifiedUserData()
|
|
| Method Summary | |
|---|---|
void |
addUserDatum(Object key,
Object value,
UserDataContainer.CopyAction shared)
Adds user-level information to the node. |
Object |
clone()
|
boolean |
containsUserDatumKey(Object key)
Reports whether key is a key of this user data container. |
UserDataContainer |
getInstance()
Returns a single UserDataContainer instance. |
protected Map |
getKeyMap(Object key)
|
Object |
getUserDatum(Object key)
Returns UserData (if any) for this key, or null if not known. |
UserDataContainer.CopyAction |
getUserDatumCopyAction(Object key)
Returns the CopyAction associated with this key. |
Iterator |
getUserDatumKeyIterator()
Returns an Iterator which can be used to iterate over
all the user data repository keys for this object. |
protected Pair |
getUserDatumValuePair(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 |
Object |
removeUserDatum(Object key)
Removes the Datum (if any) for this key, and returns it. |
void |
setUserDatum(Object key,
Object value,
UserDataContainer.CopyAction shared)
Changes the user-level information to the object. |
| Methods inherited from class edu.uci.ics.jung.utils.UserData |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Map key_meta_map
| Constructor Detail |
|---|
public UnifiedUserData()
| Method Detail |
|---|
protected Map getKeyMap(Object key)
public void addUserDatum(Object key,
Object value,
UserDataContainer.CopyAction shared)
addUserDatum in interface UserDataContainerkey - 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 UserDataContainerudc - The UserDataContainer whose user data is being imported
public void setUserDatum(Object key,
Object value,
UserDataContainer.CopyAction shared)
removeUserDatum( key ); addUserDatum(key, value)
setUserDatum in interface UserDataContainerkey - value - shared - the CopyAction for the new (key, datum) pairpublic Object getUserDatum(Object key)
getUserDatum in interface UserDataContainerkey -
protected Pair getUserDatumValuePair(Object key)
public Object removeUserDatum(Object key)
removeUserDatum in interface UserDataContainerkey -
public Iterator getUserDatumKeyIterator()
Iterator which can be used to iterate over
all the user data repository keys for this object.
getUserDatumKeyIterator in interface UserDataContainerpublic boolean containsUserDatumKey(Object key)
UserDataContainerkey is a key of this user data container.
containsUserDatumKey in interface UserDataContainerkey - the key to be queried
key is present in this user data containerUserDataContainer.containsUserDatumKey(Object)public UserDataContainer.CopyAction getUserDatumCopyAction(Object key)
getUserDatumCopyAction in interface UserDataContainerkey -
public UserDataContainer getInstance()
UserDataFactoryUserDataContainer 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 Object clone()
throws CloneNotSupportedException
clone in interface UserDataContainerclone in class UserDataCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||