Klasse DuplicationGroup

java.lang.Object
edu.hm.hafner.analysis.DuplicationGroup
Alle implementierten Schnittstellen:
Serializable

public final class DuplicationGroup extends Object implements Serializable
Links all affected files of a duplicated code fragment. A code duplication could be reported by a code duplication detector like CPD, DupFinder, or Simian.
Siehe auch:
  • Konstruktordetails

    • DuplicationGroup

      public DuplicationGroup(@CheckForNull String codeFragment)
      Creates a new duplication group for the specified code fragment.
      Parameter:
      codeFragment - the copied code fragment
    • DuplicationGroup

      public DuplicationGroup()
      Creates a new duplication group. The code fragment is not set and should be set using add(Issue).
  • Methodendetails

    • setCodeFragment

      public void setCodeFragment(@CheckForNull String codeFragment)
      Sets the code fragment of the duplication group. Once this value has been set to a non-empty value it will not change again.
      Parameter:
      codeFragment - the copied code fragment
    • add

      public void add(Issue issue)
      Adds the specified duplication (represented by an Issue instance) to this group of duplications.
      Parameter:
      issue - the issues that references the position of the duplicated code fragment
    • getCodeFragment

      public String getCodeFragment()
      Returns the code fragment that has been duplicated by all members of this group.
      Gibt zurück:
      the duplicated code fragment
    • getDuplications

      public List<Issue> getDuplications()
    • equals

      public boolean equals(@CheckForNull Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object