org.electrocodeogram.cpc.core.api.provider.track
Interface IFuzzyPositionToCloneMatchingProvider

All Superinterfaces:
IProvider

public interface IFuzzyPositionToCloneMatchingProvider
extends IProvider

API specification for fuzzy position to clone matching providers.  Such a provider is used by the CPC Track module to check whether any existing clone matches a given position an length.

Implementations of this interface are used to find an existing clone during a copy/cut operation.

Author:
vw

Method Summary
 IClone findClone(ICloneFile cloneFile, java.util.List<IClone> clones, int offset, int length)
          Checks the specified area in the given file for existing clones and returns an existing clone if it matches the specified area relatively well.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.IProvider
getProviderName, toString
 

Method Detail

findClone

IClone findClone(ICloneFile cloneFile,
                 java.util.List<IClone> clones,
                 int offset,
                 int length)
Checks the specified area in the given file for existing clones and returns an existing clone if it matches the specified area relatively well.

A typical difference in area which might not be relevant to the clone itself are leading and trailing whitespaces.

Parameters:
cloneFile - the ICloneFile in question, never null.
clones - a list of all clones within the file, never null.
offset - the start offset of the area in question, always >=0.
length - the length of the area in question, always >=0.
Returns:
an IClone instance which matches (fuzzy) the given area or NULL if no such clone was found.