org.eclipse.jgit.lib
Class RefComparator
java.lang.Object
org.eclipse.jgit.lib.RefComparator
- All Implemented Interfaces:
- java.util.Comparator<Ref>
public class RefComparator
- extends java.lang.Object
- implements java.util.Comparator<Ref>
Util for sorting (or comparing) Ref instances by name.
Useful for command line tools or writing out refs to file.
|
Method Summary |
int |
compare(Ref o1,
Ref o2)
|
static java.util.Collection<Ref> |
sort(java.util.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 |
INSTANCE
public static final RefComparator INSTANCE
- Singleton instance of RefComparator
RefComparator
public RefComparator()
compare
public int compare(Ref o1,
Ref o2)
- Specified by:
compare in interface java.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