Class SortTool.AscendingSort
java.lang.Object
com.nomagic.magicreport.engine.tools.SortTool.AscendingSort
- All Implemented Interfaces:
Serializable,Comparator<Object>
- Direct Known Subclasses:
SortTool.DescendingSort
- Enclosing class:
SortTool
protected static class SortTool.AscendingSort
extends Object
implements Comparator<Object>, Serializable
sort Collection in ascending
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAscendingSort(SortTool sortTool, String fieldName) Create ascending sort.AscendingSort(SortTool sortTool, String fieldName, boolean isCaseInsensitive) Create descending sort.AscendingSort(SortTool sortTool, Collection<String> fieldNames, boolean isCaseInsensitive) -
Method Summary
Modifier and TypeMethodDescriptionintprotected intcompareByComparable(Comparable<Object> v1, Comparable<Object> v2) protected intcompareByNull(Object o1, Object o2, boolean isUseComparable) protected intcompareByString(String v1, String v2) protected intcompareByStringIgnoreCase(String v1, String v2) protected intgetCompareResult(Object o1, Object o2, String fieldName) booleanvoidsetCaseInsensitive(boolean isCaseInsensitive) voidsetFieldNames(List<String> fieldNames) voidsetSortTool(SortTool sortTool) 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
-
Constructor Details
-
AscendingSort
Create ascending sort.- Parameters:
sortTool- the sort toolfieldName- field being sorted
-
AscendingSort
Create descending sort.- Parameters:
sortTool- the sort toolfieldName- field being sortedisCaseInsensitive- true to sort case-insensitive
-
AscendingSort
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<Object>- See Also:
-
getCompareResult
-
compareByNull
-
compareByString
-
compareByStringIgnoreCase
-
compareByComparable
-
getSortTool
-
setSortTool
-
getFieldNames
-
setFieldNames
-
isCaseInsensitive
public boolean isCaseInsensitive() -
setCaseInsensitive
public void setCaseInsensitive(boolean isCaseInsensitive)
-