@Beta public final class ElementOrder<T> extends java.lang.Object
Example usage:
MutableGraph<Integer> graph =
GraphBuilder.directed().nodeOrder(ElementOrder.<Integer>natural()).build();
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ElementOrder.Type |
The type of ordering that this object specifies.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Comparator<T> |
comparator() |
Returns the
Comparator used. |
boolean |
equals(java.lang.Object obj) |
|
int |
hashCode() |
|
static <S> ElementOrder<S> |
insertion() |
Returns an instance which specifies that insertion ordering is guaranteed.
|
static <S extends java.lang.Comparable<? super S>> |
natural() |
Returns an instance which specifies that the natural ordering of the elements is guaranteed.
|
static <S> ElementOrder<S> |
sorted(java.util.Comparator<S> comparator) |
Returns an instance which specifies that the ordering of the elements is guaranteed to be
determined by
comparator. |
java.lang.String |
toString() |
|
ElementOrder.Type |
type() |
Returns the type of ordering used.
|
static <S> ElementOrder<S> |
unordered() |
Returns an instance which specifies that no ordering is guaranteed.
|
public static <S> ElementOrder<S> unordered()
public static <S> ElementOrder<S> insertion()
public static <S extends java.lang.Comparable<? super S>> ElementOrder<S> natural()
public static <S> ElementOrder<S> sorted(java.util.Comparator<S> comparator)
comparator.public ElementOrder.Type type()
public java.util.Comparator<T> comparator()
Comparator used.java.lang.UnsupportedOperationException - if comparator is not definedpublic boolean equals(@Nullable
java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object