public class TimedBasedActionComparator extends Object implements Comparator<Action>, Serializable
It is possible to indicate the comparator to differentiate two actions that are simultaneous but not equals.
This is meaningful to sort set of actions as actions that are equals
wrt. to the comparator will be removed from the set while being different wrt. their equals()
method.
Constructor and Description |
---|
TimedBasedActionComparator()
New comparator that does not differentiate
simultaneous actions.
|
TimedBasedActionComparator(boolean onStart,
boolean diffSamePeriods)
New comparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Action a1,
Action a2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public TimedBasedActionComparator()
public TimedBasedActionComparator(boolean onStart, boolean diffSamePeriods)
onStart
- to compare the actions using their start moment. Otherwise, the comparison
is made wrt. the ending momentdiffSamePeriods
- true
to differentiate simultaneous actions.public int compare(Action a1, Action a2)
compare
in interface Comparator<Action>
Copyright © 2015 University of Nice-Sophia Antipolis. All Rights Reserved.