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
ConstructorsConstructorDescriptionAbstractCollector(int topLevelPolarity) Constructs anAbstractCollectorwith the specified top-level polarity. -
Method Summary
Modifier and TypeMethodDescriptioncollect(AcceptanceCondition acc, Consumer<D> consumer) Traverses through the givenAcceptanceConditionand 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 anAbstractCollectorwith the specified top-level polarity.- Parameters:
topLevelPolarity- the polarity for the top-level transformation
-
-
Method Details
-
transform
Description copied from interface:TransformerTransforms the given acceptance condition into another structure.- Specified by:
transformin interfaceTransformer<U>- Parameters:
acc- the acceptance condition- Returns:
- the transformed result
-
collect
Description copied from interface:CollectorTraverses through the givenAcceptanceConditionand calls the provided consumer on all the collected data.
-