@Beta public final class ElementOrder<T> extends Object
Example usage:
MutableGraph<Integer> graph =
GraphBuilder.directed().nodeOrder(ElementOrder.<Integer>natural()).build();
Modifier and Type | Class and Description |
---|---|
static class |
ElementOrder.Type
The type of ordering that this object specifies.
|
Modifier and Type | Method and Description |
---|---|
Comparator<T> |
comparator()
Returns the
Comparator used. |
boolean |
equals(Object obj) |
int |
hashCode() |
static <S> ElementOrder<S> |
insertion()
Returns an instance which specifies that insertion ordering is guaranteed.
|
static <S extends Comparable<? super S>> |
natural()
Returns an instance which specifies that the natural ordering of the elements is guaranteed.
|
static <S> ElementOrder<S> |
sorted(Comparator<S> comparator)
Returns an instance which specifies that the ordering of the elements is guaranteed to be
determined by
comparator . |
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 Comparable<? super S>> ElementOrder<S> natural()
public static <S> ElementOrder<S> sorted(Comparator<S> comparator)
comparator
.public ElementOrder.Type type()
public Comparator<T> comparator()
Comparator
used.UnsupportedOperationException
- if comparator is not definedCopyright © 2010-2016. All Rights Reserved.