Class Duplication
- java.lang.Object
-
- edu.hm.hafner.analysis.parser.dry.cpd.Duplication
-
public class Duplication extends Object
Java Bean class for a CPD duplication.- Author:
- Ullrich Hafner
-
-
Constructor Summary
Constructors Constructor Description Duplication()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFile(SourceFile file)Adds a new file to this duplication.StringgetCodeFragment()Returns the duplicate code fragment.Collection<SourceFile>getFiles()Returns all files of the duplication.intgetLines()Returns the number of duplicate lines.intgetTokens()Returns the number of duplicate tokens.voidsetCodeFragment(String codeFragment)Sets the duplicate code fragment to the specified value.voidsetLines(int lines)Sets the number of duplicate lines to the specified value.voidsetTokens(int tokens)Sets the number of duplicate tokens to the specified value.
-
-
-
Method Detail
-
addFile
public void addFile(SourceFile file)
Adds a new file to this duplication.- Parameters:
file- the new file
-
getFiles
public Collection<SourceFile> getFiles()
Returns all files of the duplication. The returned collection is read-only.- Returns:
- all files
-
getLines
public int getLines()
Returns the number of duplicate lines.- Returns:
- the lines
-
setLines
public void setLines(int lines)
Sets the number of duplicate lines to the specified value.- Parameters:
lines- the value to set
-
getTokens
public int getTokens()
Returns the number of duplicate tokens.- Returns:
- the tokens
-
setTokens
public void setTokens(int tokens)
Sets the number of duplicate tokens to the specified value.- Parameters:
tokens- the value to set
-
getCodeFragment
@CheckForNull public String getCodeFragment()
Returns the duplicate code fragment.- Returns:
- the duplicate code fragment
-
setCodeFragment
public void setCodeFragment(@CheckForNull String codeFragment)Sets the duplicate code fragment to the specified value.- Parameters:
codeFragment- the value to set
-
-