Interface SMTableDataClass
-
- All Superinterfaces:
SimilarityMeasure
- All Known Implementing Classes:
SMTableDataClassImpl
public interface SMTableDataClass extends SimilarityMeasure
This similarity measure is used in classDataClass
and is used if no other similarity measure fits to both object. To compare uncomparable objects, the data classes are compared, in general, this is null. But, there are some special cases where this do not must be the case. For example, the comparison of void and an integer object will result here. If the query is void and the case the integer object, the result should be in general1.0
and in the opposite case it should be0.0
.This behaviour can be defined in this similarity measure. Several aspects can be defined:
- Define the default similarity value -- the default is
0.0
which is desired in most cases. - Define exceptions for the default similarity. Therefor set
- query class name
- case class name
- weight
- Define if the exceptions are symmetric -- the default is
false
.
The behaviour is that first the exceptions are checked and if an exception fits the corresponding weight will be returned. If not and if symmetric interpretation is true, query and case are swapped and the exceptions are checked again. If this also fails, the default similarity value will be returned.
- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_SIMILARITY
The default similarity value is 0.0.static boolean
DEFAULT_SYMMETRIC
The default for symmetric interpretation is false.static String
NAME
Name of similarity measure is "TableDataClass".-
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
COMPONENT, COMPONENT_KEY, LOG_ORDER_NAME_NOT_FOUND
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSimilarity(DataClass queryDataClass, DataClass caseDataClass, double similarity)
Adds a similarity value for the given data classes.DataClass[]
getCaseDataClasses(DataClass forQuery)
double
getDefaultSim()
DataClass[]
getQueryDataClasses()
Similarity
getSimilarity(DataClass queryClass, DataClass caseClass)
boolean
isSymmetric()
void
removeSimilarity(DataClass queryClass, DataClass caseClass)
Removes the similarity value for the given query and case class name.void
setDefaultSim(double defaultSim)
Sets the default similarity value that is used if no similarity value for the given query and case is defined.void
setSymmetric(boolean symmetric)
-
Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
-
-
-
-
Field Detail
-
NAME
static final String NAME
Name of similarity measure is "TableDataClass".- See Also:
- Constant Field Values
-
DEFAULT_SIMILARITY
static final double DEFAULT_SIMILARITY
The default similarity value is 0.0.- See Also:
- Constant Field Values
-
DEFAULT_SYMMETRIC
static final boolean DEFAULT_SYMMETRIC
The default for symmetric interpretation is false.- See Also:
- Constant Field Values
-
-
Method Detail
-
addSimilarity
void addSimilarity(DataClass queryDataClass, DataClass caseDataClass, double similarity)
Adds a similarity value for the given data classes.- Parameters:
caseDataClass
- The data class for the case.queryDataClass
- The data class for the query.similarity
- The similarity value.
-
getCaseDataClasses
DataClass[] getCaseDataClasses(DataClass forQuery)
- Returns:
- All case data classes for that and the given query data class name a similarity value is defined.
-
getDefaultSim
double getDefaultSim()
- Returns:
- The default similarity value.
-
setDefaultSim
void setDefaultSim(double defaultSim)
Sets the default similarity value that is used if no similarity value for the given query and case is defined.
-
getQueryDataClasses
DataClass[] getQueryDataClasses()
- Returns:
- All query data class names for that a similarity value is defined.
-
getSimilarity
Similarity getSimilarity(DataClass queryClass, DataClass caseClass)
- Returns:
- The defined similarity value for the query and case data class. If no mapping for this classes is defined the null value will be returned and NOT the default similarity value.
-
isSymmetric
boolean isSymmetric()
- Returns:
- true if the similarity definitions are symmetric.
-
setSymmetric
void setSymmetric(boolean symmetric)
-
removeSimilarity
void removeSimilarity(DataClass queryClass, DataClass caseClass)
Removes the similarity value for the given query and case class name. If no similarity value is defined nothing will be removed.- Parameters:
caseClass
- the case class to be removedqueryClass
- the query class to be removed
-
-