Package net.sf.tweety.arg.adf.transform
Interface Collector<U,D>
-
- Type Parameters:
U
- the type of the additional result the collector may provideD
- the type of the objects we want to collect
- All Known Implementing Classes:
AbstractCollector
,TseitinTransformer
public interface Collector<U,D>
The concept of a collector is similar to its siblingTransformer
, we want to transform anAcceptanceCondition
into a different structure. A collector is however more flexible since it may provide two different results, one is computed while traversing through the acceptance condition beginning from the root to its leaves and the other one is computed on the way back from the leaves to the root.This is best illustrated by an example, e.g.
TseitinTransformer
which transforms an acceptance condition into a set of clauses. It starts top-down by rewriting the root connective while the names of the sub-clauses are computed bottom-up.To minimize the effort for developers see
AbstractCollector
.- Author:
- Mathias Hofer
-
-
Method Summary
Modifier and Type Method Description default U
collect(AcceptanceCondition acc, java.util.Collection<D> collection)
Traverses through the givenAcceptanceCondition
and adds all the collected data to the provided collection.U
collect(AcceptanceCondition acc, java.util.function.Consumer<D> consumer)
Traverses through the givenAcceptanceCondition
and calls the provided consumer on all the collected data.
-
-
-
Method Detail
-
collect
default U collect(AcceptanceCondition acc, java.util.Collection<D> collection)
Traverses through the givenAcceptanceCondition
and adds all the collected data to the provided collection.- Parameters:
acc
- the acceptance conditioncollection
- the collection which we use to store the collected data- Returns:
- the result we may compute while collecting data
-
collect
U collect(AcceptanceCondition acc, java.util.function.Consumer<D> consumer)
Traverses through the givenAcceptanceCondition
and calls the provided consumer on all the collected data.- Parameters:
acc
- the acceptance conditionconsumer
- the consumer which is used as a callback for the collected data.- Returns:
- the result we may compute while collecting data
-
-