org.javimmutable.collections.tree
Class ComparableComparator<V extends Comparable<V>>
java.lang.Object
org.javimmutable.collections.tree.ComparableComparator<V>
- Type Parameters:
V
-
- All Implemented Interfaces:
- Comparator<V>
@Immutable
public final class ComparableComparator<V extends Comparable<V>>
- extends Object
- implements Comparator<V>
Comparator that uses the associated type's own compareTo() method.
Places null values before non-null values in its ordering.
Method Summary |
int |
compare(V a,
V b)
|
boolean |
equals(Object o)
|
int |
hashCode()
|
static
|
of()
Creates a type appropriate reference to the singleton instance of this class. |
ComparableComparator
public ComparableComparator()
of
public static <T extends Comparable<T>> ComparableComparator<T> of()
- Creates a type appropriate reference to the singleton instance of this class.
- Type Parameters:
T
-
- Returns:
compare
public int compare(V a,
V b)
- Specified by:
compare
in interface Comparator<V extends Comparable<V>>
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object o)
- Specified by:
equals
in interface Comparator<V extends Comparable<V>>
- Overrides:
equals
in class Object
Copyright © 2014 Burton Computer Corporation. All rights reserved.