Class EditClass

java.lang.Object
org.variantsync.diffdetective.editclass.Pattern<DiffNode<?>>
org.variantsync.diffdetective.editclass.EditClass
Direct Known Subclasses:
AddToPC, AddWithMapping, Generalization, Reconfiguration, Refactoring, RemFromPC, RemWithMapping, Specialization, Untouched

public abstract class EditClass extends Pattern<DiffNode<?>>
Abstract edit class according to our ESEC/FSE'22 paper.
Author:
Paul Bittner, Sören Viegener
  • Field Details

    • diffType

      private final DiffType diffType
  • Constructor Details

    • EditClass

      public EditClass(String name, DiffType diffType)
      Each edit class handles exactly one DiffType.
      Parameters:
      name - unique identifier (see Pattern).
      diffType - This edit class matches only DiffNodes of the given DiffType.
  • Method Details

    • getDiffType

      public DiffType getDiffType()
      Returns the diff type nodes matched by this edit class.
    • matchesArtifactNode

      protected abstract boolean matchesArtifactNode(DiffNode<?> artifactNode)
      Returns true iff the given node matches this edit class.
      Parameters:
      artifactNode - Node which has node type ARTIFACT and whose DiffType is the same as getDiffType().
    • matches

      public final boolean matches(DiffNode<?> node)
      Returns true if this edit class matches the given node and is an artifact.
      Specified by:
      matches in class Pattern<DiffNode<?>>
    • anyMatch

      public boolean anyMatch(VariationDiff<?> t)
      Returns true iff this edit class matches at leat one node on the given tree.