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
public class SMIntervalImpl extends SimilarityMeasureImpl implements SMInterval
- Author:
- Rainer Maximini
-
-
Field Summary
-
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
COMPONENT, COMPONENT_KEY, LOG_ORDER_NAME_NOT_FOUND
-
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.SMInterval
DEFAULT_STRATEGY, NAME
-
-
Constructor Summary
Constructors Constructor Description SMIntervalImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Similarity
compute(DataObject queryObject, DataObject caseObject, SimilarityValuator valuator)
String
getOrderName()
String
getSimilarityToUse()
Strategy
getStrategy()
String
getSystemName()
The system name can be used to distinguish the similarity measures.protected void
initialize()
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
isInterval()
boolean
isSimilarityFor(DataClass dataclass, String orderName)
void
removeOrder()
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
-
-
-
-
Method Detail
-
compute
public Similarity compute(DataObject queryObject, DataObject caseObject, SimilarityValuator valuator)
- Specified by:
compute
in interfaceSimilarityMeasure
- Returns:
-
getOrderName
public String getOrderName()
- Specified by:
getOrderName
in interfaceSMInterval
-
setOrderName
public void setOrderName(String orderName) throws NameNotFoundException
- Specified by:
setOrderName
in interfaceSMInterval
- Throws:
NameNotFoundException
-
getSimilarityToUse
public String getSimilarityToUse()
- Specified by:
getSimilarityToUse
in interfaceSMInterval
- Returns:
- The defined name of the
SimilarityMeasure
that should be used for the elements. - See Also:
SMInterval.setSimilarityToUse(String)
-
setSimilarityToUse
public void setSimilarityToUse(String similarityToUse)
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
public Strategy getStrategy()
- Specified by:
getStrategy
in interfaceSMInterval
-
setStrategy
public void setStrategy(Strategy strategy)
- Specified by:
setStrategy
in interfaceSMInterval
-
getSystemName
public String 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:
SimilarityMeasure.compute(DataObject, DataObject, SimilarityValuator)
-
isInterval
public boolean isInterval()
- Overrides:
isInterval
in classSimilarityMeasureImpl
-
isSimilarityFor
public boolean isSimilarityFor(DataClass dataclass, String orderName)
- 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
-
-