Modifier and Type | Method and Description |
---|---|
int |
compare(Island o1,
Island o2) |
static SortingType |
getByName(java.lang.String name)
Get a sorting type by it's name.
|
java.util.Comparator<Island> |
getComparator()
Get the comparator of the sorting type.
|
java.lang.String |
getName()
Get the name of the sorting type.
|
static void |
register(java.lang.String name,
java.util.Comparator<Island> comparator)
Register a new sorting type.
|
static void |
register(java.lang.String name,
java.util.Comparator<Island> comparator,
boolean handleEqualsIslands)
Register a new sorting type.
|
java.lang.String |
toString() |
static java.util.Collection<SortingType> |
values()
Get all the sorting types.
|
public static java.util.Collection<SortingType> values()
public static SortingType getByName(java.lang.String name)
name
- The name to check.public static void register(java.lang.String name, java.util.Comparator<Island> comparator)
name
- The name for the sorting type.comparator
- The comparator for sorting the islands.public static void register(java.lang.String name, java.util.Comparator<Island> comparator, boolean handleEqualsIslands)
name
- The name for the sorting type.comparator
- The comparator for sorting the islands.handleEqualsIslands
- Should the plugin handle equals islands?
If that's false, you should handle it on your own.public java.lang.String getName()
public java.util.Comparator<Island> getComparator()
public int compare(Island o1, Island o2)
compare
in interface java.util.Comparator<Island>
public java.lang.String toString()
toString
in class java.lang.Object