public class InheritanceComparator extends Object implements Comparator, Serializable
Constructor and Description |
---|
InheritanceComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2) |
Class |
getBase() |
void |
setBase(Class base)
Set the least-derived type possible; defaults to
null . |
protected Class |
toClass(Object elem)
Subclasses can override this method to extract the class to compare
on from the elements of the collection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public void setBase(Class base)
null
.public Class getBase()
protected Class toClass(Object elem)
public int compare(Object o1, Object o2)
compare
in interface Comparator
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.