Class RelabelNodes<L extends Label>

java.lang.Object
org.variantsync.diffdetective.variation.diff.transform.RelabelNodes<L>
All Implemented Interfaces:
Transformer<VariationDiff<L>>

public class RelabelNodes<L extends Label> extends Object implements Transformer<VariationDiff<L>>
Transformer that changes the label of each node using a relable function.
Author:
Paul Bittner
  • Field Details

  • Constructor Details

    • RelabelNodes

      public RelabelNodes(Function<DiffNode<L>,L> newLabelOfNode)
      Creates a new transformation that relables each node with the given function.
      Parameters:
      newLabelOfNode - This function is invoked once for each DiffNode in the transformed VariationDiff. The returned String is set as the node's new label.
    • RelabelNodes

      public RelabelNodes(L label)
      Creates a new transformation that sets the label of each node to the given string.
      Parameters:
      label - The new label for each node in a VariationDiff.
  • Method Details

    • transform

      public void transform(VariationDiff<L> variationDiff)
      Description copied from interface: Transformer
      Apply a transformation to the given Object inplace. The object will be changed.
      Specified by:
      transform in interface Transformer<L extends Label>
      Parameters:
      variationDiff - The T object to transform.