Package jadex.commons.future
Class DuplicateRemovalIntermediateResultListener<E>
- java.lang.Object
-
- jadex.commons.future.IntermediateDelegationResultListener<E>
-
- jadex.commons.future.DuplicateRemovalIntermediateResultListener<E>
-
- All Implemented Interfaces:
IFunctionalExceptionListener
,IFunctionalIntermediateFinishedListener<E>
,IFunctionalIntermediateResultCountListener
,IFunctionalIntermediateResultListener<E>
,IFunctionalResultListener<java.util.Collection<E>>
,IFutureCommandResultListener<java.util.Collection<E>>
,IIntermediateResultListener<E>
,IResultListener<java.util.Collection<E>>
,IUndoneIntermediateResultListener<E>
,IUndoneResultListener<java.util.Collection<E>>
public class DuplicateRemovalIntermediateResultListener<E> extends IntermediateDelegationResultListener<E>
A result listener that filters duplicates.
-
-
Field Summary
Fields Modifier and Type Field Description protected BloomFilter
filter
The bloom filter.-
Fields inherited from class jadex.commons.future.IntermediateDelegationResultListener
cirlistener, clistener, crlistener, delegate, future, undone
-
-
Constructor Summary
Constructors Constructor Description DuplicateRemovalIntermediateResultListener(IIntermediateResultListener<E> delegate)
Create a new listener.DuplicateRemovalIntermediateResultListener(IIntermediateResultListener<E> delegate, boolean undone)
Create a new listener.DuplicateRemovalIntermediateResultListener(IntermediateFuture<E> future)
Create a new listener.DuplicateRemovalIntermediateResultListener(IntermediateFuture<E> future, boolean undone)
Create a new listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
customIntermediateResultAvailable(E result)
Check results before sending them further.byte[]
objectToByteArray(java.lang.Object value)
Convert a value to a byte array.void
setBloomFilter(BloomFilter filter)
Set the bloom filter used to find duplicates.-
Methods inherited from class jadex.commons.future.IntermediateDelegationResultListener
commandAvailable, customResultAvailable, exceptionOccurred, exceptionOccurredIfUndone, finished, finishedIfUndone, handleException, intermediateResultAvailable, intermediateResultAvailableIfUndone, maxResultCountAvailable, resultAvailable, resultAvailableIfUndone
-
-
-
-
Field Detail
-
filter
protected BloomFilter filter
The bloom filter.
-
-
Constructor Detail
-
DuplicateRemovalIntermediateResultListener
public DuplicateRemovalIntermediateResultListener(IIntermediateResultListener<E> delegate)
Create a new listener.- Parameters:
delegate
- The delegation target.
-
DuplicateRemovalIntermediateResultListener
public DuplicateRemovalIntermediateResultListener(IIntermediateResultListener<E> delegate, boolean undone)
Create a new listener.- Parameters:
delegate
- The delegation target.undone
- use undone methods.
-
DuplicateRemovalIntermediateResultListener
public DuplicateRemovalIntermediateResultListener(IntermediateFuture<E> future)
Create a new listener.- Parameters:
future
- The delegation target.
-
DuplicateRemovalIntermediateResultListener
public DuplicateRemovalIntermediateResultListener(IntermediateFuture<E> future, boolean undone)
Create a new listener.- Parameters:
future
- The delegation target.undone
- use undone methods.
-
-
Method Detail
-
setBloomFilter
public void setBloomFilter(BloomFilter filter)
Set the bloom filter used to find duplicates.- Parameters:
filter
- The filter.
-
customIntermediateResultAvailable
public void customIntermediateResultAvailable(E result)
Check results before sending them further.- Overrides:
customIntermediateResultAvailable
in classIntermediateDelegationResultListener<E>
- Parameters:
result
- The result.
-
objectToByteArray
public byte[] objectToByteArray(java.lang.Object value)
Convert a value to a byte array.- Parameters:
value
- The value.- Returns:
- The byte array.
-
-