Package org.semanticweb.owlapi.metrics
Class AbstractOWLMetric<M extends Serializable>
java.lang.Object
org.semanticweb.owlapi.metrics.AbstractOWLMetric<M>
- Type Parameters:
M
- the metric type
- All Implemented Interfaces:
OWLMetric<M>
,OWLOntologyChangeListener
- Direct Known Subclasses:
DLExpressivity
,DoubleValuedMetric
,IntegerValuedMetric
public abstract class AbstractOWLMetric<M extends Serializable>
extends Object
implements OWLMetric<M>, OWLOntologyChangeListener
- Since:
- 2.1.0
- Author:
- Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the metric.Gets the ontology manager which, amongst other things can be used to obtain the imports closure of the current ontology.Gets the ontologies.Gets the ontology which the value of the metric should be based on.getValue()
Gets the value of this metric.boolean
Determines if the computation of the metric should take into account the imports closure of the current ontology.void
ontologiesChanged
(List<? extends OWLOntologyChange> changes) Called when some changes have been applied to various ontologies.void
setImportsClosureUsed
(boolean b) Sets whether this metric uses the imports closure of the current ontology.void
setOntology
(OWLOntology ontology) Sets the "root" ontology.toString()
-
Constructor Details
-
AbstractOWLMetric
Instantiates a new abstract owl metric.- Parameters:
o
- the ontology to use
-
-
Method Details
-
getOntology
Description copied from interface:OWLMetric
Gets the ontology which the value of the metric should be based on.- Specified by:
getOntology
in interfaceOWLMetric<M extends Serializable>
- Returns:
- The ontology.
-
setOntology
Description copied from interface:OWLMetric
Sets the "root" ontology. The metric will be recomputed from this ontology (and potentially its imports closure if selected).- Specified by:
setOntology
in interfaceOWLMetric<M extends Serializable>
- Parameters:
ontology
- The ontology for which the metric should be computed.
-
getValue
Description copied from interface:OWLMetric
Gets the value of this metric. This value is computed w.r.t. the current ontology and possibly the imports closure (if specified).- Specified by:
getValue
in interfaceOWLMetric<M extends Serializable>
- Returns:
- An object which represents the value of this metric - calling the
toString
method of the object returned by this method will result in a human readable string that displays the value of the metric.
-
getOntologies
Gets the ontologies.- Returns:
- ontologies as a set
-
ontologiesChanged
Description copied from interface:OWLOntologyChangeListener
Called when some changes have been applied to various ontologies. These may be an axiom added or an axiom removed changes.- Specified by:
ontologiesChanged
in interfaceOWLOntologyChangeListener
- Parameters:
changes
- A list of changes that have occurred. Each change may be examined to determine which ontology it was applied to.
-
getManager
Description copied from interface:OWLMetric
Gets the ontology manager which, amongst other things can be used to obtain the imports closure of the current ontology.- Specified by:
getManager
in interfaceOWLMetric<M extends Serializable>
- Returns:
- An
OWLOntologyManager
.
-
dispose
public void dispose()Description copied from interface:OWLMetric
Disposes of the metric. If the metric attaches itself as a listener to an ontology manager then this will cause the metric to detach itself and stop listening for ontology changes.- Specified by:
dispose
in interfaceOWLMetric<M extends Serializable>
-
isImportsClosureUsed
public boolean isImportsClosureUsed()Description copied from interface:OWLMetric
Determines if the computation of the metric should take into account the imports closure of the current ontology.- Specified by:
isImportsClosureUsed
in interfaceOWLMetric<M extends Serializable>
- Returns:
true
if the imports closure of the current ontology is taken into account when computing the value of this metric, orfalse
if the imports closure isn't taken into account when computing this metric.
-
setImportsClosureUsed
public void setImportsClosureUsed(boolean b) Description copied from interface:OWLMetric
Sets whether this metric uses the imports closure of the current ontology.- Specified by:
setImportsClosureUsed
in interfaceOWLMetric<M extends Serializable>
- Parameters:
b
- the new imports closure usedtrue
if this metric uses the imports closure of the current ontology, otherwise false.
-
toString
-