E
- the type of the elementspublic final class TryComparator<E>
extends java.lang.Object
implements java.util.Comparator<E>
TryComparator
tries to compare any 2 objects by casting the first
object to a Comparable. It allows to compare any 2 objects which have the
same equality even if they are not comparable. If a Comparator is provided,
the Comparator is used to compare objects and no additional casting will be
performed.Constructor and Description |
---|
TryComparator()
Creates a
TryComparator . |
TryComparator(java.util.Comparator<? super E> comp)
Creates a
TryComparator by given Comparator. |
public TryComparator()
TryComparator
.public TryComparator(java.util.Comparator<? super E> comp)
TryComparator
by given Comparator.comp
- a Comparator