Interface VariationDiffTransformer<L extends Label>
- All Known Implementing Classes:
CollapseNestedNonEditedAnnotations
,CutNonEditedSubtrees
,FeatureExpressionFilter
,LabelWithEditClass
,NaiveMovedArtifactDetection
,RelabelNodes
,RelabelRoot
public interface VariationDiffTransformer<L extends Label>
Interface that represents inplace transformations of VariationDiffs.
A VariationDiffTransformer is intended to alter a given VariationDiff.
- Author:
- Paul Bittner
-
Method Summary
Modifier and TypeMethodDescriptionstatic <L extends Label>
voidapply
(List<VariationDiffTransformer<L>> transformers, VariationDiff<L> tree) Applies all given transformers to the given VariationDiff sequentially.static <L extends Label>
voidcheckDependencies
(List<VariationDiffTransformer<L>> transformers) Checks that the dependencies of all given VariationDiffTransformers are satisfied when applying the transformers sequentially.default List<Class<? extends VariationDiffTransformer<L>>>
Returns a list of dependencies to other transformers.void
transform
(VariationDiff<L> variationDiff) Apply a transformation to the given VariationDiff inplace.
-
Method Details
-
transform
Apply a transformation to the given VariationDiff inplace. The given tree will be changed.- Parameters:
variationDiff
- The VariationDiff to transform.
-
getDependencies
Returns a list of dependencies to other transformers. A transformer should only be run, if another transformation with the respective type was run for each type on the dependencies.- Returns:
- List of types of which instances should be run before applying this transformation.
-
checkDependencies
Checks that the dependencies of all given VariationDiffTransformers are satisfied when applying the transformers sequentially.- Parameters:
transformers
- The transformers whose dependencies to check.- Throws:
RuntimeException
- when a dependency is not met.
-
apply
static <L extends Label> void apply(List<VariationDiffTransformer<L>> transformers, VariationDiff<L> tree) Applies all given transformers to the given VariationDiff sequentially. First checks that all dependencies between transformers are met viacheckDependencies(List)
.- Parameters:
transformers
- Transformers to apply sequentially.tree
- Tree to transform inplace.
-