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 provide
D - the type of the objects we want to collect
R - 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 Details

    • AbstractCollector

      public AbstractCollector(int topLevelPolarity)
  • Method Details

    • transform

      public R transform(AcceptanceCondition acc)
      Description copied from interface: Transformer
      Transforms the given acceptance condition into another structure.
      Specified by:
      transform in interface Transformer<U>
      Parameters:
      acc - the acceptance condition
      Returns:
      the transformed result
    • collect

      public U collect(AcceptanceCondition acc, Consumer<D> consumer)
      Description copied from interface: Collector
      Traverses through the given AcceptanceCondition and calls the provided consumer on all the collected data.
      Specified by:
      collect in interface Collector<U,D>
      Parameters:
      acc - the acceptance condition
      consumer - the consumer which is used as a callback for the collected data.
      Returns:
      the result we may compute while collecting data