Package com.groiss.ds

Class MapComparator

java.lang.Object
com.groiss.ds.MapComparator
All Implemented Interfaces:
Comparator<Object>

public class MapComparator extends Object implements Comparator<Object>
Compare two maps or persistents.
  • Constructor Details

    • MapComparator

      public MapComparator(List<String> sortValues)
      Create a new MapComparator.
      Parameters:
      sortValues - a list of map keys (for fields of the persistent) for sorting.
    • MapComparator

      public MapComparator(List<String> sortValues, String groupByField)
      Create a new MapComparator.
      Parameters:
      sortValues - a list of map keys (for fields of the persistent) for sorting.
      groupByField - the value should be one of the sortValues. When sorting comes to the groupByField, dates are equal if they belong to the same group. The groups are defined by the distance to the current time: a) a) 0..45 sec, b) 1min, c) 2..45 min, d) 1 hour, e) 2..22 hours, f) 1 day, g) 2..26 days h) 1 month, i) 11 months, j) 1 year, k) n years
  • Method Details