Class SMTaxonomyClassicUserWeightsImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
-
- de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyImpl
-
- de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyWeightedNodes
-
- de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyClassicImpl
-
- de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyClassicUserWeightsImpl
-
- All Implemented Interfaces:
SMTaxonomy
,SMTaxonomyClassic
,SMTaxonomyClassicUserWeights
,SimilarityMeasure
public class SMTaxonomyClassicUserWeightsImpl extends SMTaxonomyClassicImpl implements SMTaxonomyClassicUserWeights
- Author:
- Rainer Maximini
-
-
Field Summary
-
Fields inherited from class de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyWeightedNodes
deepestNodeHeight
-
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.taxonomy.SMTaxonomyClassic
NAME, STRATEGY_DEFAULT
-
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.taxonomy.SMTaxonomyClassicUserWeights
NAME
-
-
Constructor Summary
Constructors Constructor Description SMTaxonomyClassicUserWeightsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkForDescendingWeightsTowardsRoot()
This method checks if the weights of all nodes are descending towards the root.void
checkForDuplicateNodeNames()
This method checks if the taxonomy contains duplicate node entries.void
checkForMissingWeights()
This method checks if all defined inner nodes have an associated weight.List<AtomicObject>
getDefinedNodes()
Double
getNodeWeight(AtomicObject nodeValue)
String
getSystemName()
The system name can be used to distinguish the similarity measures.Double
getWeight(AtomicObject nodeValue)
void
initClassCaches()
void
removeAllWeights()
Removes all weights.void
removeWeight(AtomicObject nodeValue)
Removes the value of the node.void
setWeight(AtomicObject nodeValue, Double weight)
-
Methods inherited from class de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyClassicImpl
compute, compute, getInnerNodeInCaseStrategy, getInnerNodeInQueryStrategy, initLeafNodeCache, initNodeWeightCache, setInnerNodeInCaseStrategy, setInnerNodeInQueryStrategy
-
Methods inherited from class de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyWeightedNodes
addNodeWeight, clearNodeWeights, removeNodeWeight
-
Methods inherited from class de.uni_trier.wi2.procake.similarity.base.taxonomy.impl.SMTaxonomyImpl
getAtomicClass, getInstanceTaxonomyOrderPredicate, initialize, isSimilarityFor
-
Methods inherited from class de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
getDataClass, getName, initializeBasedOn, 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, isForceOverride, isReusable, setForceOverride
-
Methods inherited from interface de.uni_trier.wi2.procake.similarity.base.taxonomy.SMTaxonomy
getInstanceTaxonomyOrderPredicate
-
Methods inherited from interface de.uni_trier.wi2.procake.similarity.base.taxonomy.SMTaxonomyClassic
getInnerNodeInCaseStrategy, getInnerNodeInQueryStrategy, setInnerNodeInCaseStrategy, setInnerNodeInQueryStrategy
-
-
-
-
Method Detail
-
getDefinedNodes
public List<AtomicObject> getDefinedNodes()
- Specified by:
getDefinedNodes
in interfaceSMTaxonomyClassicUserWeights
- Returns:
- A list of defined AtomicObjects
- See Also:
AtomicObject
-
getNodeWeight
public Double getNodeWeight(AtomicObject nodeValue)
- Overrides:
getNodeWeight
in classSMTaxonomyWeightedNodes
-
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
- Overrides:
getSystemName
in classSMTaxonomyClassicImpl
- Returns:
- The system name of the similarity measure. This is equal to SimilarityMeasure.NAME.
-
getWeight
public Double getWeight(AtomicObject nodeValue)
- Specified by:
getWeight
in interfaceSMTaxonomyClassicUserWeights
- Parameters:
nodeValue
- The value of the node.- Returns:
- The weight of the given node. If no weight is defined, null will be returned.
-
removeWeight
public void removeWeight(AtomicObject nodeValue)
Description copied from interface:SMTaxonomyClassicUserWeights
Removes the value of the node. If no value exists, noting happens.- Specified by:
removeWeight
in interfaceSMTaxonomyClassicUserWeights
- Parameters:
nodeValue
- A nodes is specified by its value.
-
removeAllWeights
public void removeAllWeights()
Description copied from interface:SMTaxonomyClassicUserWeights
Removes all weights.- Specified by:
removeAllWeights
in interfaceSMTaxonomyClassicUserWeights
-
setWeight
public void setWeight(AtomicObject nodeValue, Double weight)
- Specified by:
setWeight
in interfaceSMTaxonomyClassicUserWeights
weight
- must be between 0 and 1
-
initClassCaches
public void initClassCaches()
- Overrides:
initClassCaches
in classSMTaxonomyClassicImpl
-
checkForDuplicateNodeNames
public void checkForDuplicateNodeNames()
This method checks if the taxonomy contains duplicate node entries. A duplicate in the taxonomy-structure is not allowed. A duplicate in the value-enumeration is eliminated because this value enumeration is internally stored as a set.
-
checkForDescendingWeightsTowardsRoot
public void checkForDescendingWeightsTowardsRoot()
This method checks if the weights of all nodes are descending towards the root. This is required by the definition of the taxonomy.
-
checkForMissingWeights
public void checkForMissingWeights()
This method checks if all defined inner nodes have an associated weight. Whereas the node itself is defined in the model, the similarity weight is defined in the similarity model.
-
-