Package org.eclipse.steady.java.sign
Class ASTSignatureComparator
- java.lang.Object
-
- org.eclipse.steady.java.sign.ASTSignatureComparator
-
- All Implemented Interfaces:
SignatureComparator
public class ASTSignatureComparator extends Object implements SignatureComparator
ASTSignatureComparator class.
-
-
Constructor Summary
Constructors Constructor Description ASTSignatureComparator()Constructor for ASTSignatureComparator.ASTSignatureComparator(double stringSimilarity)Constructor for ASTSignatureComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SignatureChangecomputeChange(Signature _a, Signature _b)floatcomputeSimilarity(Signature _a, Signature _b)booleancontainsChange(Signature _s, SignatureChange _change)Returns true of the given signature contains the given change, false otherwise.intgetMatchedNumChanges()getMatchedNumChanges.doublegetStringSimilarityThreshold()getStringSimilarityThreshold.intgetTotalNumChanges()getTotalNumChanges.booleansearchForEntity(ch.uzh.ifi.seal.changedistiller.model.entities.SourceCodeChange change, ch.uzh.ifi.seal.changedistiller.treedifferencing.Node astRoot)Search for the _entityUniqueName inside Signature (Search using the Node Label)booleansearchForEntity(String _entityUniqueName, ch.uzh.ifi.seal.changedistiller.treedifferencing.Node astRoot)Search for the _entityUniqueName inside Signature (Search using the Node Label)ch.uzh.ifi.seal.changedistiller.treedifferencing.NodesearchForNode(ch.uzh.ifi.seal.changedistiller.model.entities.SourceCodeChange change, ch.uzh.ifi.seal.changedistiller.treedifferencing.Node astRoot)Search for the specified change element inside Signature (Search using the Node Label)voidsetStringSimilarityThreshold(double _threshold)setStringSimilarityThreshold.
-
-
-
Method Detail
-
computeSimilarity
public float computeSimilarity(Signature _a, Signature _b)
- Specified by:
computeSimilarityin interfaceSignatureComparator
-
computeChange
public SignatureChange computeChange(Signature _a, Signature _b)
- Specified by:
computeChangein interfaceSignatureComparator
-
getTotalNumChanges
public int getTotalNumChanges()
getTotalNumChanges.
- Returns:
- a int.
-
getMatchedNumChanges
public int getMatchedNumChanges()
getMatchedNumChanges.
- Returns:
- a int.
-
containsChange
public boolean containsChange(Signature _s, SignatureChange _change)
Returns true of the given signature contains the given change, false otherwise.- Specified by:
containsChangein interfaceSignatureComparator
-
getStringSimilarityThreshold
public double getStringSimilarityThreshold()
getStringSimilarityThreshold.
- Returns:
- a double.
-
setStringSimilarityThreshold
public void setStringSimilarityThreshold(double _threshold)
setStringSimilarityThreshold.
- Parameters:
_threshold- a double.
-
searchForNode
public ch.uzh.ifi.seal.changedistiller.treedifferencing.Node searchForNode(ch.uzh.ifi.seal.changedistiller.model.entities.SourceCodeChange change, ch.uzh.ifi.seal.changedistiller.treedifferencing.Node astRoot)Search for the specified change element inside Signature (Search using the Node Label)- Parameters:
astRoot- The AST to be searchedchange- aSourceCodeChangeobject.- Returns:
- the Node matching the change elements EntityType and Value public : for testing purpose, switch to private once done testing
-
searchForEntity
public boolean searchForEntity(ch.uzh.ifi.seal.changedistiller.model.entities.SourceCodeChange change, ch.uzh.ifi.seal.changedistiller.treedifferencing.Node astRoot)Search for the _entityUniqueName inside Signature (Search using the Node Label)- Parameters:
astRoot- The AST to be searchedchange- aSourceCodeChangeobject.- Returns:
- true if entity is within the AST public : for testing purpose, switch to private once done testing
-
searchForEntity
public boolean searchForEntity(String _entityUniqueName, ch.uzh.ifi.seal.changedistiller.treedifferencing.Node astRoot)
Search for the _entityUniqueName inside Signature (Search using the Node Label)- Parameters:
_entityUniqueName- aStringobject.astRoot- The AST to be searched- Returns:
- true if entity is within the AST public : for testing purpose, switch to private once done testing
-
-