|
||||||||||
| 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.DefaultUserData
public class DefaultUserData
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.setUserInfo ("3DData", new 3DData (
)).
Later, to access this information, the call might be 3DData dd =
(3DData) n.getUserInfo("3DData").
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
|---|
UserDataContainer.CopyAction |
| Field Summary |
|---|
| Fields inherited from class edu.uci.ics.jung.utils.UserData |
|---|
CLONE, REMOVE, SHARED |
| Constructor Summary | |
|---|---|
DefaultUserData()
|
|
| Method Summary | |
|---|---|
void |
addUserDatum(Object key,
Object value,
UserDataContainer.CopyAction shared)
Adds user-level information to the node. |
Object |
clone()
This class actually clones by removing the reference to the copyAction and userData |
boolean |
containsUserDatumKey(Object key)
Reports whether key is a key of this user data container. |
UserDataContainer |
getInstance()
Returns a single UserDataContainer instance. |
Object |
getUserDatum(Object key)
Returns UserInfo (if known) for this key, or null if not known. |
UserDataContainer.CopyAction |
getUserDatumCopyAction(Object key)
Returns the CopyAction associated with this key. |
Iterator |
getUserDatumKeyIterator()
Iterates through the keys to all registered data. |
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 known) 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 |
| Constructor Detail |
|---|
public DefaultUserData()
| Method Detail |
|---|
public Object clone()
throws CloneNotSupportedException
clone in interface UserDataContainerclone in class UserDataCloneNotSupportedException
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 -
public Object removeUserDatum(Object key)
removeUserDatum in interface UserDataContainerkey -
public Iterator getUserDatumKeyIterator()
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||