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 ClassesThenInterfacesElementKindComparatorThe sole instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionfinal intcompare(ElementKind k0, ElementKind k1) Compares the twoElementKinds and returns the result.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 twoElementKinds and returns the result.If
k0 == k1, returns0.If
k0isnullandk1is not, returns a positive value.If
k0is a class andk1is an interface, returns a negative value.If
k0is an interface andk1is a class, returns a positive value.Returns
0in all other cases.- Specified by:
comparein interfaceComparator<ElementKind>- Parameters:
k0- anElementKind; may benullk1- anElementKind; may benull- Returns:
- a comparison result
- See Also:
-