public class CollectListAccumulateFunction extends AbstractAccumulateFunction<CollectListAccumulateFunction.CollectListData>
An implementation of an accumulator capable of collecting lists of values. This is similar to the "collect" CE, but allows us to collect any value, not only facts.
Example:
rule "List employee names" when $names : List() from accumulate( Employee( $n : firstName, $l : lastName ), collectList( $n + " " + $l ) ) then // do something end
The list accepts duplications and the order of the elements in the list is not guaranteed.
Modifier and Type | Class and Description |
---|---|
static class |
CollectListAccumulateFunction.CollectListData |
Constructor and Description |
---|
CollectListAccumulateFunction() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(CollectListAccumulateFunction.CollectListData data,
Object value) |
CollectListAccumulateFunction.CollectListData |
createContext() |
Object |
getResult(CollectListAccumulateFunction.CollectListData data) |
Class<?> |
getResultType() |
void |
init(CollectListAccumulateFunction.CollectListData data) |
void |
readExternal(ObjectInput in) |
void |
reverse(CollectListAccumulateFunction.CollectListData data,
Object value) |
boolean |
supportsReverse() |
void |
writeExternal(ObjectOutput out) |
equals, hashCode
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
IOException
public CollectListAccumulateFunction.CollectListData createContext()
public void init(CollectListAccumulateFunction.CollectListData data)
public void accumulate(CollectListAccumulateFunction.CollectListData data, Object value)
public void reverse(CollectListAccumulateFunction.CollectListData data, Object value)
public Object getResult(CollectListAccumulateFunction.CollectListData data)
public boolean supportsReverse()
public Class<?> getResultType()
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.