java.lang.Object
org.jgrapht.graph.guava.ElementOrderMethod<T>
- Type Parameters:
T- the element type
- All Implemented Interfaces:
java.io.Serializable
public class ElementOrderMethod<T>
extends java.lang.Object
implements java.io.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 classElementOrderMethod.TypeElement order method type -
Method Summary
Modifier and Type Method Description java.util.Comparator<T>comparator()Get the comparator.static <T> ElementOrderMethod<T>comparator(java.util.Comparator<T> comparator)Get the comparator ordering method.ElementOrderMethod.TypegetType()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 Details
-
natural
Get the natural ordering method- Type Parameters:
T- the element type- Returns:
- the natural ordering method
-
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
Get the comparator ordering method.- Type Parameters:
T- the element type- Parameters:
comparator- the actual comparator- Returns:
- the comparator ordering method
-
guavaComparator
Get the guava comparator ordering method.- Type Parameters:
T- the element type- Returns:
- the comparator ordering method
-
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
Get the type- Returns:
- the type
-