- java.lang.Object
-
- org.jgrapht.graph.guava.ElementOrderMethod<T>
-
- Type Parameters:
T
- the element type
- All Implemented Interfaces:
Serializable
public class ElementOrderMethod<T> extends Object implements Serializable
Represents the method of ensuring the existence of a total order of a set of elements.- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ElementOrderMethod.Type
Element order method type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparator<T>
comparator()
Get the comparator.static <T> ElementOrderMethod<T>
comparator(Comparator<T> comparator)
Get the comparator ordering method.ElementOrderMethod.Type
getType()
Get the typestatic <T> ElementOrderMethod<T>
guavaComparator()
Get the guava comparator ordering method.static <T> ElementOrderMethod<T>
internal()
Get the internal ordering method.static <T> ElementOrderMethod<T>
natural()
Get the natural ordering method
-
-
-
Method Detail
-
natural
public static <T> ElementOrderMethod<T> natural()
Get the natural ordering method- Type Parameters:
T
- the element type- Returns:
- the natural ordering method
-
internal
public static <T> ElementOrderMethod<T> internal()
Get the internal ordering method. This represents the method of explicitly maintaining a map from the elements to long integers. Thus, it incurs a penalty in space and in lookups.- Type Parameters:
T
- the element type- Returns:
- the internal ordering method
-
comparator
public static <T> ElementOrderMethod<T> comparator(Comparator<T> comparator)
Get the comparator ordering method.- Type Parameters:
T
- the element type- Parameters:
comparator
- the actual comparator- Returns:
- the comparator ordering method
-
guavaComparator
public static <T> ElementOrderMethod<T> guavaComparator()
Get the guava comparator ordering method.- Type Parameters:
T
- the element type- Returns:
- the comparator ordering method
-
comparator
public Comparator<T> comparator()
Get the comparator. Returns null if the method does not use an explicit comparator.- Returns:
- the comparator or null if the method does not use an explicit comparator
-
getType
public ElementOrderMethod.Type getType()
Get the type- Returns:
- the type
-
-