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 Details

    • HumanAscendingSort

      public HumanAscendingSort(SortTool sortTool, String fieldName)
      Create ascending sort.
      Parameters:
      sortTool - the sort tool
      fieldName - field being sorted
    • HumanAscendingSort

      public HumanAscendingSort(SortTool sortTool, String fieldName, boolean isCaseInsensitive)
      Create ascending sort.
      Parameters:
      sortTool - the sort tool
      fieldName - field being sorted
      isCaseInsensitive - true to sort case-insensitive
    • HumanAscendingSort

      public HumanAscendingSort(SortTool sortTool, Collection<String> fieldNames, boolean isCaseInsensitive)
      Create ascending sort.
      Parameters:
      sortTool - the sort tool
      fieldNames - collection of field being sorted
      isCaseInsensitive - true to sort case-insensitive
  • Method Details

    • compare

      public int compare(Object o1, Object o2)
      Compares its two arguments for order.
      Specified by:
      compare in interface Comparator<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

      protected int compareByNull(Object v1, Object v2)
    • compareByDouble

      protected int compareByDouble(double dv1, double dv2)
    • compareByString

      protected int compareByString(String token1, String token2)
    • compareByStringIgnoreCase

      protected int compareByStringIgnoreCase(String token1, String token2)
    • compareByLength

      protected int compareByLength(String s1, String s2)
    • getSortTool

      public SortTool getSortTool()
    • setSortTool

      public void setSortTool(SortTool sortTool)
    • getFieldNames

      public List<String> getFieldNames()
    • setFieldNames

      public void setFieldNames(List<String> fieldNames)
    • isCaseInsensitive

      public boolean isCaseInsensitive()
    • setCaseInsensitive

      public void setCaseInsensitive(boolean isCaseInsensitive)