Interface SMTableDataClass
- All Superinterfaces:
SimilarityMeasure
- All Known Implementing Classes:
SMTableDataClassImpl
This similarity measure is used in class
DataClass
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 general 1.0
and in the opposite
case it should be 0.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
Modifier and TypeFieldDescriptionstatic final double
The default similarity value is 0.0.static final boolean
The default for symmetric interpretation is false.static final String
Name of similarity measure is "TableDataClass".Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
LOG_ORDER_NAME_NOT_FOUND
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSimilarity
(DataClass queryDataClass, DataClass caseDataClass, double similarity) Adds a similarity value for the given data classes.getCaseDataClasses
(DataClass forQuery) double
getSimilarity
(DataClass queryClass, DataClass caseClass) boolean
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 Details
-
NAME
Name of similarity measure is "TableDataClass".- See Also:
-
DEFAULT_SIMILARITY
static final double DEFAULT_SIMILARITYThe default similarity value is 0.0.- See Also:
-
DEFAULT_SYMMETRIC
static final boolean DEFAULT_SYMMETRICThe default for symmetric interpretation is false.- See Also:
-
-
Method Details
-
addSimilarity
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
- 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
- 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
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
-