Class SMAggregateWeightedImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
-
- de.uni_trier.wi2.procake.similarity.base.aggregate.impl.SMAggregateImpl
-
- de.uni_trier.wi2.procake.similarity.base.aggregate.impl.SMAggregateWeightedImpl
-
- All Implemented Interfaces:
SMAggregate,SMAggregateWeighted,SimilarityMeasure
- Direct Known Subclasses:
SMAggregateAverageImpl,SMAggregateKMaximumImpl,SMAggregateKMinimumImpl,SMAggregateMaximumImpl,SMAggregateMinimumImpl,SMAggregateMinkowskiImpl
public abstract class SMAggregateWeightedImpl extends SMAggregateImpl implements SMAggregateWeighted
- Author:
- rmaximi
-
-
Field Summary
Fields Modifier and Type Field Description protected intk-
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.aggregate.SMAggregate
COMPONENT, COMPONENT_KEY, DEFAULT_IGNORE_NULL_ATTRIBUTES_IN_QUERY, LOG_ATTRIBUTE_NAME_NOT_FOUND, LOG_ATTRIBUTE_NOT_FOUND, PROPERTY_USER_WEIGHT
-
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.aggregate.SMAggregateWeighted
DEFAULT_WEIGHT
-
-
Constructor Summary
Constructors Constructor Description SMAggregateWeightedImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDefaultWeight()Map<String,Double>getUserSimWeightsNormalized(AggregateObject dataObject)doublegetWeight(String attributeName)protected voidinitializeBasedOn(SimilarityMeasure base)Initialize measure based on existing instancebooleanisEveryUserSimWeightZero(Map<String,Double> weights)voidsetDefaultWeight(double defaultWeight)voidsetWeight(String attributeName, double weight)protected SimilarityImplvalidateQueryNotEmpty(DataObject queryObject, DataObject caseObject)-
Methods inherited from class de.uni_trier.wi2.procake.similarity.base.aggregate.impl.SMAggregateImpl
computeAttributeSimilarity, isIgnoreNullAttributesInQuery, isSimilarityFor, setIgnoreNullAttributesInQuery
-
Methods inherited from class de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
getDataClass, getName, initialize, isAggregate, isForceOverride, isInterval, 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
compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
-
Methods inherited from interface de.uni_trier.wi2.procake.similarity.base.aggregate.SMAggregate
isIgnoreNullAttributesInQuery, setIgnoreNullAttributesInQuery
-
-
-
-
Method Detail
-
getWeight
public double getWeight(String attributeName) throws NameNotFoundException
- Specified by:
getWeightin interfaceSMAggregateWeighted- Returns:
- double the weight of the given attribute. If the weight is not set, the default weight 1.0 will be returned.
- Throws:
NameNotFoundException
-
setWeight
public void setWeight(String attributeName, double weight) throws NameNotFoundException
- Specified by:
setWeightin interfaceSMAggregateWeighted- Parameters:
attributeName- is the name of the attribute whos weight should be setweight- is the weight of the attribute. The values will normalized automatically.- Throws:
NameNotFoundException- if the attribute not exists
-
getUserSimWeightsNormalized
public Map<String,Double> getUserSimWeightsNormalized(AggregateObject dataObject)
-
getDefaultWeight
public double getDefaultWeight()
- Specified by:
getDefaultWeightin interfaceSMAggregateWeighted- Returns:
- default weight
-
setDefaultWeight
public void setDefaultWeight(double defaultWeight)
- Specified by:
setDefaultWeightin interfaceSMAggregateWeighted- Parameters:
defaultWeight- is the default weight for each attribute, which hasn't an own weight
-
initializeBasedOn
protected void initializeBasedOn(SimilarityMeasure base)
Description copied from class:SimilarityMeasureImplInitialize measure based on existing instance- Overrides:
initializeBasedOnin classSMAggregateImpl- Parameters:
base- similarity measure to base on
-
validateQueryNotEmpty
@Nullable protected SimilarityImpl validateQueryNotEmpty(DataObject queryObject, DataObject caseObject)
-
-