Class SMIntervalImpl
java.lang.Object
de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
de.uni_trier.wi2.procake.similarity.base.impl.SMIntervalImpl
- All Implemented Interfaces:
SMInterval
,SimilarityMeasure
- Author:
- Rainer Maximini
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
LOG_ORDER_NAME_NOT_FOUND
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.SMInterval
DEFAULT_STRATEGY, NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompute
(DataObject queryObject, DataObject caseObject, SimilarityValuator valuator) The system name can be used to distinguish the similarity measures.protected void
This method will be called after theDataClass
is set bycake.data.similarity.SimilarityMeasureImpl#compute(cake.data.objects.DataObject, de.uni_trier.wi2.procake.data.objects.DataObject)
.boolean
boolean
isSimilarityFor
(DataClass dataclass, String orderName) void
Similarity measure for intervals can work also on the natural order of a AtomicDataClass if available.void
setOrderName
(String orderName) void
setSimilarityToUse
(String similarityToUse) In general, the element objects of the interval are compared with their default similarity measure.void
setStrategy
(Strategy strategy) Methods inherited from class de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
getDataClass, getName, initializeBasedOn, isAggregate, isForceOverride, isNumeric, isObject, isReusable, isSet, isTable, isTaxonomy, isText, setDataClass, setForceOverride, setName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
getDataClass, getName, isForceOverride, isReusable, setForceOverride
-
Constructor Details
-
SMIntervalImpl
public SMIntervalImpl()
-
-
Method Details
-
compute
public Similarity compute(DataObject queryObject, DataObject caseObject, SimilarityValuator valuator) - Specified by:
compute
in interfaceSimilarityMeasure
- Returns:
-
getOrderName
- Specified by:
getOrderName
in interfaceSMInterval
-
setOrderName
- Specified by:
setOrderName
in interfaceSMInterval
- Throws:
ProCAKENameNotFoundException
-
getSimilarityToUse
- Specified by:
getSimilarityToUse
in interfaceSMInterval
- Returns:
- The defined name of the
SimilarityMeasure
that should be used for the elements. - See Also:
-
setSimilarityToUse
Description copied from interface:SMInterval
In general, the element objects of the interval are compared with their default similarity measure. But in some situations it can be necessary to use another similarity measure for the elements of an interval. Therefore, it exists the possibility to specify a similarity measure name that should be used instead. For eachDataObject
a similarity measure with that name should exist. Otherwise, the comparision of objects are ignored.Summarizing:
- If the
newValue
isnull
the default measures of the objects are used. This is the default behaviour. - If the
newValue
is the name of a similarity measure, for each data class whose objects can be occured in the interval a similarity measure with this name must exist.
- Specified by:
setSimilarityToUse
in interfaceSMInterval
- Parameters:
similarityToUse
- The name of the similarity measure that should be used for the elements.
- If the
-
getStrategy
- Specified by:
getStrategy
in interfaceSMInterval
-
setStrategy
- Specified by:
setStrategy
in interfaceSMInterval
-
getSystemName
Description copied from interface:SimilarityMeasure
The system name can be used to distinguish the similarity measures. Each similarity measure that can be instantiated contains a static final field called NAME representing the system name, e.g.,SMAggregateEuclidian.NAME
The system name must also be given during initialization, see
SimilarityModel.createSimilarityMeasure(String, DataClass)
.- Specified by:
getSystemName
in interfaceSimilarityMeasure
- Returns:
- The system name of the similarity measure. This is equal to SimilarityMeasure.NAME.
-
initialize
protected void initialize()Description copied from class:SimilarityMeasureImpl
This method will be called after theDataClass
is set bycake.data.similarity.SimilarityMeasureImpl#compute(cake.data.objects.DataObject, de.uni_trier.wi2.procake.data.objects.DataObject)
. Override this method to initialize yourSimilarityMeasure
.- Overrides:
initialize
in classSimilarityMeasureImpl
- See Also:
-
isInterval
public boolean isInterval()- Overrides:
isInterval
in classSimilarityMeasureImpl
-
isSimilarityFor
- Specified by:
isSimilarityFor
in classSimilarityMeasureImpl
-
removeOrder
public void removeOrder()Description copied from interface:SMInterval
Similarity measure for intervals can work also on the natural order of a AtomicDataClass if available. Therefore, it is possible to remove an already assigned order.- Specified by:
removeOrder
in interfaceSMInterval
-