Class AbstractComparator<C>
- java.lang.Object
-
- org.silverpeas.core.util.comparator.AbstractComparator<C>
-
- Type Parameters:
C
-
- All Implemented Interfaces:
Serializable
,Comparator<C>
- Direct Known Subclasses:
AbstractComplexComparator
public abstract class AbstractComparator<C> extends Object implements Comparator<C>, Serializable
This tool handles all the boilerplate of sort implementations of list of data.By default, the text comparison takes not care about accent and case.
To deactivate this behavior, please call from constructorstrictComparisonOnText()
method.- Author:
- yohann.chastagnier
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> int
compare(Comparable<? super T> comp1, T comp2)
Centralizes bean comparison mechanismprotected void
strictComparisonOnText()
If called, then the text comparison will be strict.-
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
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
strictComparisonOnText
protected void strictComparisonOnText()
If called, then the text comparison will be strict.
-
compare
protected <T> int compare(Comparable<? super T> comp1, T comp2)
Centralizes bean comparison mechanism- Returns:
- see
Comparator.compare(Object, Object)
.
-
-