T - the class of the referred-to objectpublic class ComparableRef<T extends Comparable<? super T>> extends Ref<T> implements Comparable<ComparableRef<T>>
Comparable.| Constructor and Description |
|---|
ComparableRef(T object)
Construct a
ComparableRef with the given value. |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<? super T>> |
compare(T a,
T b)
Compare two objects for order, allowing for nulls.
|
int |
compareTo(ComparableRef<T> o)
Compare this reference with another for order.
|
public ComparableRef(T object)
ComparableRef with the given value.object - the value for the objectpublic int compareTo(ComparableRef<T> o)
ComparableRef.compareTo in interface Comparable<ComparableRef<T extends Comparable<? super T>>>o - the other referenceComparable.compareTo(Object)public static <T extends Comparable<? super T>> int compare(T a, T b)
public and static so that it may be used as a comparison of two object
references even when the ComparableRef class is not used.T - class of the objectsa - the first objectb - the second objectCopyright © 2020. All rights reserved.