Interface ICodeBlockGroup
-
- All Known Implementing Classes:
EntityCodeBlockGroup
public interface ICodeBlockGroupAn interface that connects multiple ICodeBlocks where plagiarism is detected between those files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCodeBlock(ISourceFile file, float score, java.util.List<ITuple<java.lang.Integer,java.lang.Integer>> lines)Adds a code block to the groupvoidaddCodeBlock(ISourceFile file, float score, ITuple<java.lang.Integer,java.lang.Integer> line)Adds a code block to the groupbooleanfilePresent(ISourceFile file)Tests whether a passed file is included in the groupICodeBlockgetCodeBlock(ISourceFile file)return the block of code for a specific filejava.util.List<? extends ICodeBlock>getCodeBlocks()java.lang.StringgetComment()DetectionTypegetDetectionType()booleanisPopulated()Check whether the group covers at least two filesvoidsetComment(java.lang.String comment)Set the comment string for this blockvoidsetDetectionType(java.lang.String detectionTypeIdentifier)Set the detection type for this blockbooleansubmissionIdPresent(long submissionId)Tests whether any files in the group belong to the specified submission
-
-
-
Method Detail
-
addCodeBlock
void addCodeBlock(ISourceFile file, float score, ITuple<java.lang.Integer,java.lang.Integer> line)
Adds a code block to the group- Parameters:
file- File containing the blockscore- score (0 to 1) of the block within the group, eg: 1 means block exactly matches the other blocks in the groupline- Tuple containing the start and end line of the code block
-
addCodeBlock
void addCodeBlock(ISourceFile file, float score, java.util.List<ITuple<java.lang.Integer,java.lang.Integer>> lines)
Adds a code block to the group- Parameters:
file- File containing the blockscore- score (0 to 1) of the block within the group, eg: 1 means block exactly matches the other blocks in the grouplines- list of tuples, each containing the start and end line of the code block, the block covers multiple groups of non-consecutive lines in this file
-
filePresent
boolean filePresent(ISourceFile file)
Tests whether a passed file is included in the group- Parameters:
file- file to test- Returns:
- is the file present?
-
submissionIdPresent
boolean submissionIdPresent(long submissionId)
Tests whether any files in the group belong to the specified submission- Parameters:
submissionId- the ID of the submission to test- Returns:
- true if there is such a file, false otherwise
-
getCodeBlock
ICodeBlock getCodeBlock(ISourceFile file)
return the block of code for a specific file- Parameters:
file- file to search- Returns:
- the files blocks
-
getCodeBlocks
java.util.List<? extends ICodeBlock> getCodeBlocks()
- Returns:
- the blocks of code that were flagged as similar
-
getComment
java.lang.String getComment()
- Returns:
- extra string comment or detail regarding this code block
-
setComment
void setComment(java.lang.String comment)
Set the comment string for this block- Parameters:
comment- string
-
getDetectionType
DetectionType getDetectionType() throws UnknownDetectionTypeException
- Returns:
- the type of plagiarism that was detected for these blocks of code
- Throws:
UnknownDetectionTypeException- thrown if the stored identifier is not registered in the current session
-
setDetectionType
void setDetectionType(java.lang.String detectionTypeIdentifier) throws UnknownDetectionTypeExceptionSet the detection type for this block- Parameters:
detectionTypeIdentifier- detection type- Throws:
UnknownDetectionTypeException- thrown if the passed identifier is not registered in the current session
-
isPopulated
boolean isPopulated()
Check whether the group covers at least two files- Returns:
- isPopulated
-
-