Class ClassesThenInterfacesElementKindComparator
java.lang.Object
org.microbean.assign.ClassesThenInterfacesElementKindComparator
- All Implemented Interfaces:
Comparator<ElementKind>
public final class ClassesThenInterfacesElementKindComparator
extends Object
implements Comparator<ElementKind>
- Author:
- Laird Nelson
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassesThenInterfacesElementKindComparator
The sole instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionfinal int
compare
(ElementKind k0, ElementKind k1) Compares the twoElementKind
s and returns the result.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
-
Field Details
-
INSTANCE
The sole instance of this class.
-
-
Method Details
-
compare
Compares the twoElementKind
s and returns the result.If
k0 == k1
, returns0
.If
k0
isnull
andk1
is not, returns a positive value.If
k0
is a class andk1
is an interface, returns a negative value.If
k0
is an interface andk1
is a class, returns a positive value.Returns
0
in all other cases.- Specified by:
compare
in interfaceComparator<ElementKind>
- Parameters:
k0
- anElementKind
; may benull
k1
- anElementKind
; may benull
- Returns:
- a comparison result
- See Also:
-