www.sdmetrics.com

com.sdmetrics.metrics
Class MetricStore

java.lang.Object
  extended by com.sdmetrics.metrics.MetricStore

public class MetricStore
extends java.lang.Object

Reads a metric definition file and provides access to metrics, sets, and rules defined therein.

The class also maintains the matrices, literature references, glossary entries, and word lists defined in the file, as well as custom defined metric, set, and rule procedures, and custom scalar, boolean, or set operations.


Field Summary
static java.lang.String TL_ELEMENT
          The name of the top level XML element in the metric definition file.
 
Constructor Summary
MetricStore(MetaModel metaModel)
          Creates a new metric store.
 
Method Summary
 java.util.Collection<Glossary> getGlossary()
          Gets the list of all glossary terms defined in the metric definition file.
 java.util.Collection<Reference> getLiteratureReferences()
          Gets the list of all literature references defined in the metric definition file.
 java.util.List<Matrix> getMatrices()
          Gets the list of all relationship matrices defined in the metric definition file.
 MetaModel getMetaModel()
          Gets the metamodel on which the metrics are based
 Metric getMetric(MetaModelElement type, java.lang.String name)
          Gets the metric for a given element type by its name.
 java.util.Collection<Metric> getMetrics(MetaModelElement type)
          Gets the list of all metrics for a given element type.
 Rule getRule(MetaModelElement type, java.lang.String name)
          Gets the rule for a given element type by its name.
 java.util.Collection<Rule> getRules(MetaModelElement type)
          Gets the list of all rules for a given element type.
 org.xml.sax.helpers.DefaultHandler getSAXParserHandler()
          Gets a SAX handler to parse a metric definition file and store its contents with this object.
 Set getSet(MetaModelElement type, java.lang.String name)
          Gets the set for a given element type by its name.
 java.util.Collection<Set> getSets(MetaModelElement type)
          Gets the list of all sets for a given element type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TL_ELEMENT

public static final java.lang.String TL_ELEMENT
The name of the top level XML element in the metric definition file.

See Also:
Constant Field Values
Constructor Detail

MetricStore

public MetricStore(MetaModel metaModel)
Creates a new metric store.

Parameters:
metaModel - Metamodel on which the metrics are based.
Method Detail

getSAXParserHandler

public org.xml.sax.helpers.DefaultHandler getSAXParserHandler()
Gets a SAX handler to parse a metric definition file and store its contents with this object.

Returns:
SAX handler to parse metrics definition file

getMetaModel

public MetaModel getMetaModel()
Gets the metamodel on which the metrics are based

Returns:
the metamodel for this metric store

getMetric

public Metric getMetric(MetaModelElement type,
                        java.lang.String name)
Gets the metric for a given element type by its name.

Parameters:
type - Element type for which the metric is defined.
name - Name of the metric.
Returns:
the specified metric, or null if no such metric was found.

getSet

public Set getSet(MetaModelElement type,
                  java.lang.String name)
Gets the set for a given element type by its name.

Parameters:
type - Element type for which the set is defined.
name - Name of the set.
Returns:
the specified set, or null if no such set was found.

getRule

public Rule getRule(MetaModelElement type,
                    java.lang.String name)
Gets the rule for a given element type by its name.

Parameters:
type - Element type for which the rule is defined.
name - Name of the rule.
Returns:
the specified rule, or null if no such rule was found.
Since:
2.3

getMetrics

public java.util.Collection<Metric> getMetrics(MetaModelElement type)
Gets the list of all metrics for a given element type.

Parameters:
type - Element type for which to return the metrics.
Returns:
The metrics for the type. Iteration over this collection preserves the order in which the metrics are defined in the metric definition file.

getSets

public java.util.Collection<Set> getSets(MetaModelElement type)
Gets the list of all sets for a given element type.

Parameters:
type - Element type for which to return the sets.
Returns:
The sets for the type.

getRules

public java.util.Collection<Rule> getRules(MetaModelElement type)
Gets the list of all rules for a given element type.

Parameters:
type - Element type for which to return the rules.
Returns:
The rules for the type. Iteration over this collection preserves the order in which the rules are defined in the metric definition file.

getMatrices

public java.util.List<Matrix> getMatrices()
Gets the list of all relationship matrices defined in the metric definition file.

Returns:
Random access list containing the matrices in the order they appear in the metric definition file.

getLiteratureReferences

public java.util.Collection<Reference> getLiteratureReferences()
Gets the list of all literature references defined in the metric definition file.

Returns:
The literature references. Iteration over this collection preserves the order in which the references are defined in the metric definition file.

getGlossary

public java.util.Collection<Glossary> getGlossary()
Gets the list of all glossary terms defined in the metric definition file.

Returns:
The glossary terms. Iteration over this collection preserves the order in which the glossary terms are defined in the metric definition file.

www.sdmetrics.com