|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.lib.RefComparator
public class RefComparator
Util for sorting (or comparing) Ref instances by name.
Useful for command line tools or writing out refs to file.
Field Summary | |
---|---|
static RefComparator |
INSTANCE
Singleton instance of RefComparator |
Constructor Summary | |
---|---|
RefComparator()
|
Method Summary | |
---|---|
int |
compare(Ref o1,
Ref o2)
|
static int |
compareTo(Ref o1,
Ref o2)
Compare two references by name. |
static int |
compareTo(Ref o1,
String o2)
Compare a reference to a name. |
static Collection<Ref> |
sort(Collection<Ref> refs)
Sorts the collection of refs, returning a new collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
public static final RefComparator INSTANCE
Constructor Detail |
---|
public RefComparator()
Method Detail |
---|
public int compare(Ref o1, Ref o2)
compare
in interface Comparator<Ref>
public static Collection<Ref> sort(Collection<Ref> refs)
refs
- collection to be sorted
public static int compareTo(Ref o1, String o2)
o1
- the reference instance.o2
- the name to compare to.
public static int compareTo(Ref o1, Ref o2)
o1
- the reference instance.o2
- the other reference instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |