Comparator<Ref>
public class RefComparator extends Object implements Comparator<Ref>
Useful for command line tools or writing out refs to file.
Modifier and Type | Field | Description |
---|---|---|
static RefComparator |
INSTANCE |
Singleton instance of RefComparator
|
Constructor | Description |
---|---|
RefComparator() |
Modifier and Type | Method | Description |
---|---|---|
int |
compare(Ref o1,
Ref o2) |
|
static int |
compareTo(Ref o1,
String o2) |
Compare a reference to a name.
|
static int |
compareTo(Ref o1,
Ref o2) |
Compare two references by name.
|
static Collection<Ref> |
sort(Collection<Ref> refs) |
Sorts the collection of refs, returning a new collection.
|
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final RefComparator INSTANCE
public int compare(Ref o1, Ref o2)
compare
in interface Comparator<Ref>
public static Collection<Ref> sort(Collection<Ref> refs)
refs
- collection to be sortedpublic static int compareTo(Ref o1, String o2)
o1
- the reference instance.o2
- the name to compare to.Copyright © 2018. All rights reserved.