Class 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>
    Direct Known Subclasses:
    TseitinTransformer

    public abstract class AbstractCollector<U,​D,​R>
    extends java.lang.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

      Constructors 
      Constructor Description
      AbstractCollector​(int topLevelPolarity)  
    • Method Summary

      Modifier and Type Method Description
      U collect​(AcceptanceCondition acc, java.util.function.Consumer<D> consumer)
      Traverses through the given AcceptanceCondition and calls the provided consumer on all the collected data.
      R transform​(AcceptanceCondition acc)
      Transforms the given acceptance condition into another structure.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.tweetyproject.arg.adf.transform.Collector

        collect
    • Constructor Detail

      • AbstractCollector

        public AbstractCollector​(int topLevelPolarity)
    • Method Detail

      • 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,
                         java.util.function.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