Package net.sf.tweety.arg.adf.transform
Class AbstractCollector<U,D,R>
- java.lang.Object
-
- net.sf.tweety.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>
- Direct Known Subclasses:
TseitinTransformer
public abstract class AbstractCollector<U,D,R> extends Object implements Transformer<R>, Collector<U,D>
Similar toAbstractTransformerbut is designed for collections and therefore providesCollectorfunctionality for free.- Author:
- Mathias Hofer
-
-
Constructor Summary
Constructors Constructor Description AbstractCollector()
-
Method Summary
Modifier and Type Method Description Ucollect(AcceptanceCondition acc, Consumer<D> consumer)Traverses through the givenAcceptanceConditionand calls the provided consumer on all the collected data.protected abstract Rfinish(U bottomUpData, Collection<D> collection)protected abstract Collection<D>initialize()Provides the initial top-down data.protected inttopLevelPolarity()Rtransform(AcceptanceCondition acc)Transforms the given acceptance condition into another structure.protected Utransform(AcceptanceCondition acc, Consumer<D> userObject)protected abstract UtransformArgument(Argument argument, Consumer<D> collection, int polarity)protected abstract UtransformConjunction(Collection<U> children, Consumer<D> collection, int polarity)protected abstract UtransformContradiction(Consumer<D> collection, int polarity)protected abstract UtransformDisjunction(Collection<U> children, Consumer<D> collection, int polarity)protected abstract UtransformEquivalence(Collection<U> children, Consumer<D> collection, int polarity)protected abstract UtransformExclusiveDisjunction(U left, U right, Consumer<D> collection, int polarity)protected abstract UtransformImplication(U left, U right, Consumer<D> collection, int polarity)protected abstract UtransformNegation(U child, Consumer<D> collection, int polarity)protected abstract UtransformTautology(Consumer<D> collection, int polarity)
-
-
-
Method Detail
-
transform
public R transform(AcceptanceCondition acc)
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
-
transform
protected U transform(AcceptanceCondition acc, Consumer<D> userObject)
-
topLevelPolarity
protected int topLevelPolarity()
-
collect
public U collect(AcceptanceCondition acc, Consumer<D> consumer)
Description copied from interface:CollectorTraverses through the givenAcceptanceConditionand calls the provided consumer on all the collected data.
-
initialize
protected abstract Collection<D> initialize()
Provides the initial top-down data.- Returns:
- the initial top-down data
-
finish
protected abstract R finish(U bottomUpData, Collection<D> collection)
-
transformDisjunction
protected abstract U transformDisjunction(Collection<U> children, Consumer<D> collection, int polarity)
-
transformConjunction
protected abstract U transformConjunction(Collection<U> children, Consumer<D> collection, int polarity)
-
transformImplication
protected abstract U transformImplication(U left, U right, Consumer<D> collection, int polarity)
-
transformEquivalence
protected abstract U transformEquivalence(Collection<U> children, Consumer<D> collection, int polarity)
-
transformExclusiveDisjunction
protected abstract U transformExclusiveDisjunction(U left, U right, Consumer<D> collection, int polarity)
-
transformNegation
protected abstract U transformNegation(U child, Consumer<D> collection, int polarity)
-
transformArgument
protected abstract U transformArgument(Argument argument, Consumer<D> collection, int polarity)
-
transformContradiction
protected abstract U transformContradiction(Consumer<D> collection, int polarity)
-
-