Class ClassComparator
java.lang.Object
org.pentaho.reporting.libraries.serializer.ClassComparator
- All Implemented Interfaces:
Serializable
,Comparator<Class>
The class comparator can be used to compare and sort classes and their superclasses. The comparator is not able to
compare classes which have no relation...
- Author:
- Thomas Morgner
- See Also:
-
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
-
ClassComparator
public ClassComparator()Defaultconstructor.
-
-
Method Details
-
compare
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.- Specified by:
compare
in interfaceComparator<Class>
- Parameters:
c1
- the first object to be compared.c2
- the second object to be compared.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
isComparable
Checks, whether the given classes are comparable. This method will return true, if one of the classes is assignable from the other class.- Parameters:
c1
- the first class to comparec2
- the second class to compare- Returns:
- true, if the classes share a direct relation, false otherwise.
-