|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgov.usda.gdpc.Identifier
This is an identifier which should uniquely identify a database element for a given database element type (e.g. Locus) and datasource.
| Constructor Summary | |
Identifier(java.lang.String name)
Identifier constructor. |
|
Identifier(java.lang.String name,
java.lang.String[] hints)
Identifier constructor. |
|
| Method Summary | |
java.lang.String |
asString()
Returns string representation of this identifier. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object obj)
This determines if two identifiers are equal. |
java.lang.String |
getHint(int index)
Get hint at given index. |
java.lang.String[] |
getHints()
Get list of hints. |
int |
getNumber()
Return identifier as number. |
int |
numHints()
Returns the number of defined hints. |
java.lang.String |
toString()
Returns string representation of this identifier. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Identifier(java.lang.String name)
name - Unique string representation of this identifier. Can not
be null.
public Identifier(java.lang.String name,
java.lang.String[] hints)
name - Unique string representation of this identifier. Can not
be null.hints - Hints for convenience. These hints do not
make the identifier unique.| Method Detail |
public java.lang.String asString()
public java.lang.String toString()
public int numHints()
public java.lang.String getHint(int index)
throws java.lang.IndexOutOfBoundsException
index - index
java.lang.IndexOutOfBoundsExceptionpublic java.lang.String[] getHints()
public int getNumber()
throws java.lang.NumberFormatException
java.lang.NumberFormatExceptionpublic boolean equals(java.lang.Object obj)
obj - object to test
public int compareTo(java.lang.Object o)
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
compareTo in interface java.lang.Comparableo - the Object to be compared.
java.lang.ClassCastException - if the specified object's type prevents it
from being compared to this Object.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||