|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.util.TaggedObject
An object-id or object-tag pair. Sometimes it is useful to assign a tag or numeric ID to an object for purposes of identification. Most commonly the identifier is a unique integer, but in some circumstances it is more appropriate to use another object as an identifier. This class allows an object to be associated with either an integer or an arbitrary object.
Field Summary | |
private int |
id
|
private java.lang.Object |
obj
|
private java.lang.Object |
tag
|
Constructor Summary | |
TaggedObject(java.lang.Object obj,
int id)
Construct a new TaggedObject for the given user object
and numerical ID. |
|
TaggedObject(java.lang.Object obj,
java.lang.Object tag)
Construct a new TaggedObject for the given user object
and identifier object. |
Method Summary | |
int |
getID()
Get the numerical ID. |
java.lang.Object |
getObject()
Get the user object. |
java.lang.Object |
getTag()
Get the identifier object. |
java.lang.String |
toString()
Get a string representation of the tagged object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.Object obj
private java.lang.Object tag
private int id
Constructor Detail |
public TaggedObject(java.lang.Object obj, java.lang.Object tag)
TaggedObject
for the given user object
and identifier object.
obj
- The user object.tag
- The identifier object.public TaggedObject(java.lang.Object obj, int id)
TaggedObject
for the given user object
and numerical ID.
obj
- The user object.id
- The numerical ID.Method Detail |
public final java.lang.Object getObject()
public final int getID()
-1
if there is no numerical ID
for this object.public final java.lang.Object getTag()
null
if there is no
identifier object for this object.public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |