|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.virtuosotechnologies.lib.util.StringID
A immutable string ID class. This is basically a numbering system of natural numbers expressed as strings of lower-case letters. There is no upper limit to the numbering.
The representation is NOT base-26! It's kind of similar, but not the same. For example, the next value after "z" is "aa". Clients should generally use the getNext() method and the implementation of Comparable rather than trying to interpret the value themselves.
Constructor Summary | |
StringID()
Constructs a new id with value "" |
|
StringID(long value)
Constructs a new id with a nonnegative integer value. |
|
StringID(String value)
Constructs a new id with the given value |
|
StringID(StringID value)
Constructs a new id with the given value |
Method Summary | |
Object |
clone()
Implementation of Object.clone(). |
int |
compareTo(Object obj)
Implementation of Comparable.compareTo(). |
boolean |
equals(Object obj)
Implementation of Object.equals(). |
StringID |
getNext()
Gets the next id |
String |
getValue()
Returns the current value |
int |
hashCode()
Implementation of Object.hashCode(). |
static boolean |
isWellFormed(String str)
Determines whether a string is a well-formed value for StringID |
char[] |
toCharArray()
Returns a copy of the character array |
String |
toString()
Implementation of Object.toString(). |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StringID()
public StringID(String value)
value
- initial value
IllegalArgumentException
- value was badly formattedpublic StringID(StringID value)
value
- initial valuepublic StringID(long value)
value
- initial valueMethod Detail |
public static boolean isWellFormed(String str)
str
- string to test
public char[] toCharArray()
public String getValue()
public StringID getNext()
public int compareTo(Object obj)
compareTo
in interface Comparable
obj
- object to compare with
public String toString()
public boolean equals(Object obj)
public int hashCode()
public Object clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |