Package org.eclipse.jgit.lib
Class RefComparator
- java.lang.Object
-
- org.eclipse.jgit.lib.RefComparator
-
-
Field Summary
Fields Modifier and Type Field Description static RefComparator
INSTANCE
Singleton instance of RefComparator
-
Constructor Summary
Constructors Constructor Description RefComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Ref o1, Ref o2)
static int
compareTo(Ref o1, java.lang.String o2)
Compare a reference to a name.static int
compareTo(Ref o1, Ref o2)
Compare two references by name.static java.util.Collection<Ref>
sort(java.util.Collection<Ref> refs)
Sorts the collection of refs, returning a new collection.
-
-
-
Field Detail
-
INSTANCE
public static final RefComparator INSTANCE
Singleton instance of RefComparator
-
-
Method Detail
-
compare
public int compare(Ref o1, Ref o2)
- Specified by:
compare
in interfacejava.util.Comparator<Ref>
-
sort
public static java.util.Collection<Ref> sort(java.util.Collection<Ref> refs)
Sorts the collection of refs, returning a new collection.- Parameters:
refs
- collection to be sorted- Returns:
- sorted collection of refs
-
compareTo
public static int compareTo(Ref o1, java.lang.String o2)
Compare a reference to a name.- Parameters:
o1
- the reference instance.o2
- the name to compare to.- Returns:
- standard Comparator result of < 0, 0, > 0.
-
-