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 sibling
Transformer
, we
want to transform an AcceptanceCondition
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 TypeMethodDescriptiondefault U
collect
(AcceptanceCondition acc, Collection<D> collection) Traverses through the givenAcceptanceCondition
and adds all the collected data to the provided collection.collect
(AcceptanceCondition acc, Consumer<D> consumer) Traverses through the givenAcceptanceCondition
and calls the provided consumer on all the collected data.
-
Method Details
-
collect
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
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
-