|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.innig.util.EnumeratedType
net.innig.util.OrderedType
public abstract class OrderedType
An enumerated type with a natural ordering.
| Maturity: This class is relatively new. It looks great in unit testing, but hasn't seen real-world use yet. |
| Plans: Perhaps add JDO support. |
| Constructor Summary | |
|---|---|
OrderedType(java.lang.String name)
Creates a new enumerated type, ordered relative to its peers according to its lexical order in the source code. |
|
OrderedType(java.lang.String name,
java.lang.Comparable order)
Creates a new enumerated type, ordered relative to its peers of the same class by a comparable object. |
|
OrderedType(java.lang.String name,
int order)
Creates a new enumerated type, ordered relative to its peers of the same class by an integer. |
|
| Method Summary | |
|---|---|
static java.util.SortedSet |
allTypeNamesSorted(java.lang.Class orderedTypeClass)
Returns the set of valid type names for the given enumerated type class, in the type's (not the names') natural order. |
static java.util.SortedSet |
allTypesSorted(java.lang.Class orderedTypeClass)
Returns the ordered set of valid types for the given enumerated type class. |
static java.util.Comparator |
comparator(java.lang.Class orderedTypeClass)
Returns the comparator which gives the natural ordering on the given class. |
int |
compareTo(java.lang.Object that)
|
boolean |
greaterThan(OrderedType that)
|
boolean |
greaterThanEq(OrderedType that)
|
boolean |
lessThan(OrderedType that)
|
boolean |
lessThanEq(OrderedType that)
|
static java.util.Comparator |
nameComparator(java.lang.Class orderedTypeClass)
Returns a comparator which orders Strings by the natural ordering of their corresponding ordered types in the given class. |
| Methods inherited from class net.innig.util.EnumeratedType |
|---|
allTypeNames, allTypes, equals, getName, hashCode, resolveFromName, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedType(java.lang.String name)
public OrderedType(java.lang.String name,
int order)
public OrderedType(java.lang.String name,
java.lang.Comparable order)
| Method Detail |
|---|
public static java.util.SortedSet allTypesSorted(java.lang.Class orderedTypeClass)
java.lang.IllegalArgumentException - if the given class is not a subclass of OrderedType.public static java.util.SortedSet allTypeNamesSorted(java.lang.Class orderedTypeClass)
java.lang.IllegalArgumentException - if the given class is not a subclass of OrderedType.public static java.util.Comparator comparator(java.lang.Class orderedTypeClass)
public static java.util.Comparator nameComparator(java.lang.Class orderedTypeClass)
public final int compareTo(java.lang.Object that)
compareTo in interface java.lang.Comparablepublic final boolean greaterThan(OrderedType that)
public final boolean greaterThanEq(OrderedType that)
public final boolean lessThan(OrderedType that)
public final boolean lessThanEq(OrderedType that)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||