public final class AlphaNumericName extends CacheableDataType implements Comparable<AlphaNumericName>
All constructors for this class are private. Creating instances of
AlphaNumericName is done via the static methods on the class.
Instances of this class are immutable, making them inherently threadsafe.
This class overrides equals(java.lang.Object) and hashCode() so that instances
play nicely with the Collection classes.
This class implements the Comparable interface to ensure that a
sorted list of names is presented in an intuitive order. In particular, case
is ignored, and numeric suffixes are taken into account. For example:
A1 A2 A3 A11 A12 A20 B1 B5 B12 | Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AlphaNumericName other)
Overridden to (a) ignore case, and (b) take embedded numbers into
account.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
static AlphaNumericName |
valueOf(String str)
Returns an object representing the value of the specified alpha-numeric
name.
|
getRefQ, keyFromBytespublic int compareTo(AlphaNumericName other)
compareTo in interface Comparable<AlphaNumericName>other - the other instance we are comparing topublic boolean equals(Object o)
Note that this comparison ignores case.
public static AlphaNumericName valueOf(String str)
str - the string representation of the alpha-numeric nameNullPointerException - if the string is nullIllegalArgumentException - if the string is blankCopyright © 2014. All Rights Reserved.