Package org.eclipse.core.commands.common
Class NamedHandleObjectComparator
java.lang.Object
org.eclipse.core.commands.common.NamedHandleObjectComparator
- All Implemented Interfaces:
Comparator
Comparator for instances of
NamedHandleObject
for display to
an end user. The comparison is based on the name of the instances.- Since:
- 3.2
-
Constructor Summary
Constructors -
Method Summary
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
NamedHandleObjectComparator
public NamedHandleObjectComparator()
-
-
Method Details
-
compare
Compares to instances of NamedHandleObject based on their names. This is useful is they are display to an end user.- Specified by:
compare
in interfaceComparator
- Parameters:
left
- The first obect to compare; may benull
.right
- The second object to compare; may benull
.- Returns:
-1
ifleft
isnull
andright
is notnull
;0
if they are bothnull
;1
ifleft
is notnull
andright
isnull
. Otherwise, the result ofleft.compareTo(right)
.
-