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 Details

    • transform

      void transform(VariationDiff<L> variationDiff)
      Apply a transformation to the given VariationDiff inplace. The given tree will be changed.
      Parameters:
      variationDiff - The VariationDiff to transform.
    • getDependencies

      default List<Class<? extends VariationDiffTransformer<L>>> 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

      static <L extends Label> void checkDependencies(List<VariationDiffTransformer<L>> transformers)
      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 via checkDependencies(List).
      Parameters:
      transformers - Transformers to apply sequentially.
      tree - Tree to transform inplace.