Class ActionListPriorityComparator
java.lang.Object
org.kuali.rice.kew.actionlist.dao.impl.ActionListPriorityComparator
- All Implemented Interfaces:
Comparator<ActionItemContract>
Compares an action item to another action item and determines if one
item has a higher priority than the other.
Therefore, calling code needs to ensure that the document and user on the item
are the same. If action items for different documents are passed in, then the
compare method should always return 0.
If the response returned from compare is less than 0, it means the first argument is
lower priority than the second. If a value greater than 0 is returned it means the
first argument has a higher priority then the second. If the result returned is 0, then
the two action items have the same priority.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(ActionItemContract actionItem1, ActionItemContract actionItem2) protected booleanrequiresComparison(ActionItemContract actionItem1, ActionItemContract actionItem2) Returns whether or not the two action items require comparison.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
-
ActionListPriorityComparator
public ActionListPriorityComparator()
-
-
Method Details
-
compare
public int compare(ActionItemContract actionItem1, ActionItemContract actionItem2) throws ClassCastException - Specified by:
comparein interfaceComparator<ActionItemContract>- Throws:
ClassCastException
-
requiresComparison
protected boolean requiresComparison(ActionItemContract actionItem1, ActionItemContract actionItem2) Returns whether or not the two action items require comparison. The Action List only operates on Action Items for a single user and we only care about comparing the action items if they are on the same document and for the same user.
-