Class AbstractCollector<U,D,R>
java.lang.Object
org.tweetyproject.arg.adf.transform.AbstractCollector<U,D,R>
- Type Parameters:
U
- the type of the additional result the collector may provideD
- the type of the objects we want to collectR
- the result of the transformation
- All Implemented Interfaces:
Collector<U,
,D> Transformer<R>
public abstract class AbstractCollector<U,D,R>
extends Object
implements Transformer<R>, Collector<U,D>
Similar to
AbstractTransformer
but is designed for collections and
therefore provides Collector
functionality for free.- Author:
- Mathias Hofer
-
Constructor Summary
ConstructorDescriptionAbstractCollector
(int topLevelPolarity) Constructs anAbstractCollector
with the specified top-level polarity. -
Method Summary
Modifier and TypeMethodDescriptioncollect
(AcceptanceCondition acc, Consumer<D> consumer) Traverses through the givenAcceptanceCondition
and calls the provided consumer on all the collected data.Transforms the given acceptance condition into another structure.
-
Constructor Details
-
AbstractCollector
public AbstractCollector(int topLevelPolarity) Constructs anAbstractCollector
with the specified top-level polarity.- Parameters:
topLevelPolarity
- the polarity for the top-level transformation
-
-
Method Details
-
transform
Description copied from interface:Transformer
Transforms the given acceptance condition into another structure.- Specified by:
transform
in interfaceTransformer<U>
- Parameters:
acc
- the acceptance condition- Returns:
- the transformed result
-
collect
Description copied from interface:Collector
Traverses through the givenAcceptanceCondition
and calls the provided consumer on all the collected data.
-