|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.spif.Id
A unique id. Supports subclassing for type-specific id's.
Subclass this to make type ids by naming the type id's
Constructor Summary | |
Id(java.lang.String uniqueValue)
Create a unique id from a unique string |
Method Summary | |
int |
compareTo(java.lang.Object object)
Comparable is implemented to support consistent ordering of id collections. |
java.lang.Object |
createTypeInstance()
Creates an instance of the type this is an id for. |
boolean |
equals(java.lang.Object id)
|
java.lang.Class |
getType()
Returns the type of this id as a class. |
java.lang.String |
getTypeName()
Returns the type of this id. |
int |
hashCode()
|
java.lang.String |
stringValue()
Returns the string value of this id |
java.lang.String |
toString()
Returns a string describing this id |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Id(java.lang.String uniqueValue)
Method Detail |
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object id)
equals
in class java.lang.Object
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
public java.lang.String getTypeName()
Returns the type of this id. The type is by definition the short class name of this class preceeding "Id". So if you have an id class org.foo.BarId, the type name returned is "Bar". The type of a non-subclassed id is the empty string.
A different naming scheme can be facilitated by overriding this method (and probably createTypeInstance and getType as well).
public java.lang.Class getType()
java.lang.RuntimeException
- if it can not find the classpublic java.lang.Object createTypeInstance()
ReflectionException
- if the type could not be createdpublic java.lang.String stringValue()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |