|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISimilarityStrategyTask
Parameter value for ISimilarityStrategy.calculateSimilarity(org.electrocodeogram.cpc.core.api.provider.store.IStoreProvider, ISimilarityStrategyTask)
.
Field Summary | |
---|---|
static int |
PROCESSING_STATUS_FILTERED
Set once an ISimilarityStrategy has filtered out parts of the
the processed contents. |
static int |
PROCESSING_STATUS_NORMALISED_IDENTIFIERS
Set once an ISimilarityStrategy has normalised identifiers of
the processed contents. |
static int |
PROCESSING_STATUS_NORMALISED_WHITESPACE
Set once an ISimilarityStrategy has normalised white spaces of
the processed contents. |
Method Summary | |
---|---|
void |
addScore(double score,
double weight)
This method may be called only once per strategy. |
int |
getAverageScore()
Retrieves the current average weighted score of all strategies which have been executed for this task. |
IClone |
getClone1()
Retrieves the first clone for this comparison. |
IClone |
getClone2()
Retrieves the second clone for this comparison. |
java.lang.String |
getLanguage()
Retrieves the language for the given clone fragments. |
java.lang.String |
getProcessedContent1()
Retrieves the processed/normalised content for clone1. |
java.lang.String |
getProcessedContent2()
Retrieves the processed/normalised content for clone2. |
int |
getProcessingStatus()
Retrieves the processing status of the two processed content strings. |
boolean |
isForceNonEqual()
Whether the final similarity between the two clones needs to be capped at 99%. |
void |
markForceNonEqual()
A strategy has to call this method if it detects any semantic difference between the two code fragments. |
void |
setProcessedContent1(java.lang.String processedContent1,
int processingStatus)
Updates the processed/normalised content for clone1. |
void |
setProcessedContent2(java.lang.String processedContent2,
int processingStatus)
Updates the processed/normalised content for clone2. |
Field Detail |
---|
static final int PROCESSING_STATUS_FILTERED
ISimilarityStrategy
has filtered out parts of the
the processed contents. I.e. comments.
static final int PROCESSING_STATUS_NORMALISED_WHITESPACE
ISimilarityStrategy
has normalised white spaces of
the processed contents.
static final int PROCESSING_STATUS_NORMALISED_IDENTIFIERS
ISimilarityStrategy
has normalised identifiers of
the processed contents.
Method Detail |
---|
void addScore(double score, double weight)
score
- weight
- boolean isForceNonEqual()
ISimilarityProvider
API specification which
states that a similarity of 100% must only be returned if the two code sections
are guaranteed to be semantically equivalent.
void markForceNonEqual()
isForceNonEqual()
int getAverageScore()
isForceNonEqual()
is true.
java.lang.String getLanguage()
ISimilarityProvider
, never null.IClone getClone1()
IClone getClone2()
int getProcessingStatus()
setProcessedContent1(String, int)
java.lang.String getProcessedContent1()
void setProcessedContent1(java.lang.String processedContent1, int processingStatus)
IClone.getContent()
may not be modified.
processedContent1
- the new content for clone1, never null.processingStatus
- bit mask which indicates the kinds of modifications made to the content,
data is additive. There is no need to pass through bits set earlier. Bits can't be unset.
There is one bit mask for both contents.java.lang.String getProcessedContent2()
SimilarityStrategyTask.getProcessedContent1()
void setProcessedContent2(java.lang.String processedContent2, int processingStatus)
setProcessedContent1(String, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |