Package com.groiss.ds
Class MapComparator
java.lang.Object
com.groiss.ds.MapComparator
- All Implemented Interfaces:
Comparator<Object>
Compare two maps or persistents.
-
Constructor Summary
ConstructorDescriptionMapComparator
(List<String> sortValues) Create a new MapComparator.MapComparator
(List<String> sortValues, String groupByField) Create a new MapComparator. -
Method Summary
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
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
MapComparator
Create a new MapComparator.- Parameters:
sortValues
- a list of map keys (for fields of the persistent) for sorting.
-
MapComparator
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
-
compare
- Specified by:
compare
in interfaceComparator<Object>
-