Class SortTool.HumanAscendingSort
java.lang.Object
com.nomagic.magicreport.engine.tools.SortTool.HumanAscendingSort
- All Implemented Interfaces:
Serializable,Comparator<Object>
- Direct Known Subclasses:
SortTool.HumanDescendingSort
- Enclosing class:
SortTool
@OpenApiAll
protected static class SortTool.HumanAscendingSort
extends Object
implements Comparator<Object>, Serializable
Sort Collection in ascending.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHumanAscendingSort(SortTool sortTool, String fieldName) Create ascending sort.HumanAscendingSort(SortTool sortTool, String fieldName, boolean isCaseInsensitive) Create ascending sort.HumanAscendingSort(SortTool sortTool, Collection<String> fieldNames, boolean isCaseInsensitive) Create ascending sort. -
Method Summary
Modifier and TypeMethodDescriptionintCompares its two arguments for order.protected intcompareByDouble(double dv1, double dv2) protected intcompareByLength(String s1, String s2) protected intcompareByNull(Object v1, Object v2) protected intcompareByString(String token1, String token2) protected intcompareByStringIgnoreCase(String token1, String token2) 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
-
HumanAscendingSort
Create ascending sort.- Parameters:
sortTool- the sort toolfieldName- field being sorted
-
HumanAscendingSort
Create ascending sort.- Parameters:
sortTool- the sort toolfieldName- field being sortedisCaseInsensitive- true to sort case-insensitive
-
HumanAscendingSort
public HumanAscendingSort(SortTool sortTool, Collection<String> fieldNames, boolean isCaseInsensitive) Create ascending sort.- Parameters:
sortTool- the sort toolfieldNames- collection of field being sortedisCaseInsensitive- true to sort case-insensitive
-
-
Method Details
-
compare
Compares its two arguments for order.- Specified by:
comparein interfaceComparator<Object>- Parameters:
o1- the first object to be compared.o2- 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.
- See Also:
-
compareByNull
-
compareByDouble
protected int compareByDouble(double dv1, double dv2) -
compareByString
-
compareByStringIgnoreCase
-
compareByLength
-
getSortTool
-
setSortTool
-
getFieldNames
-
setFieldNames
-
isCaseInsensitive
public boolean isCaseInsensitive() -
setCaseInsensitive
public void setCaseInsensitive(boolean isCaseInsensitive)
-