|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<CollectionOperator> org.kuali.rice.krms.framework.engine.CollectionOperator
public enum CollectionOperator
Enumeration for simple collection operators used by CollectionOfComparablesTermBasedProposition
. The
operators encapsulate logic for how to collate results and when to short circuit as a collection is being
processed. Correct usage is best summarized by this code block:
for (Comparableitem : comparableItems) { collatedResult = collectionOper.reduce(compare(item, compareValue), collatedResult); if (collectionOper.shortCircuit(collatedResult)) break; }
Enum Constant Summary | |
---|---|
ALL
|
|
NONE
|
|
ONE_OR_MORE
|
Method Summary | |
---|---|
boolean |
getInitialCollatedResult()
when the result for the first item in the collection is calculated, there isn't yet a collated result to use in the reduce(boolean, boolean) method. |
abstract boolean |
reduce(boolean elementResult,
boolean collatedResult)
This method takes the collated result thus far and the result for the next element, and produces the next collated result. |
abstract boolean |
shortCircuit(boolean collatedResult)
This method lets the engine know if it can short circuit its iteration through the list based on the collated result. |
static CollectionOperator |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static CollectionOperator[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final CollectionOperator ONE_OR_MORE
public static final CollectionOperator ALL
public static final CollectionOperator NONE
Method Detail |
---|
public static CollectionOperator[] values()
for (CollectionOperator c : CollectionOperator.values()) System.out.println(c);
public static CollectionOperator valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic abstract boolean reduce(boolean elementResult, boolean collatedResult)
public abstract boolean shortCircuit(boolean collatedResult)
collatedResult
-
public boolean getInitialCollatedResult()
reduce(boolean, boolean)
method. Different operators require different
initial values to function correctly, so this property holds the correct initial collated value for the
given operator instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |