www.sdmetrics.com

com.sdmetrics.metrics
Enum DescriptionLocator

java.lang.Object
  extended by java.lang.Enum<DescriptionLocator>
      extended by com.sdmetrics.metrics.DescriptionLocator
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DescriptionLocator>

public enum DescriptionLocator
extends java.lang.Enum<DescriptionLocator>

Enumerates the locators for metrics, rules, and so forth in descriptions in the metric definition files.

Locators are used to cross-reference metrics, rules, matrices, literature references and glossary items in the documentation of these items. Because of their hyperlink character, locators are constructed like URLs. The string "metric://class/NumOps/" for example references the design metric "NumOps" for elements of type "class".

We call the "metric://" part of the locator its prefix (rather than protocol as there is no communication protocol implied). The "class/NumOps/" part are the parameters of the locator. Each locator has a fixed number of parameters.


Enum Constant Summary
GLOSSARY
          Locator for glossary entries.
MATRIX
          Locator for matrices.
METRIC
          Locator for metrics.
REFERENCE
          Locator for literature references.
RULE
          Locator for rules.
 
Method Summary
 int getParameterCount()
          Gets the number of parameters this locator expects following the prefix.
 java.lang.String getPrefix()
          Gets the prefix of this locator.
static DescriptionLocator valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DescriptionLocator[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

METRIC

public static final DescriptionLocator METRIC
Locator for metrics. Has two parameters "element type" and "metric name".


RULE

public static final DescriptionLocator RULE
Locator for rules. Has two parameters "element type" and "rule name".


MATRIX

public static final DescriptionLocator MATRIX
Locator for matrices. Has one parameter "matrix name".


REFERENCE

public static final DescriptionLocator REFERENCE
Locator for literature references. Has one parameter "citation handle".


GLOSSARY

public static final DescriptionLocator GLOSSARY
Locator for glossary entries. Has two parameters "term" and "link text".

Method Detail

values

public static DescriptionLocator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DescriptionLocator c : DescriptionLocator.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DescriptionLocator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getPrefix

public java.lang.String getPrefix()
Gets the prefix of this locator.

Returns:
Prefix of the locators.

getParameterCount

public int getParameterCount()
Gets the number of parameters this locator expects following the prefix.

Returns:
Number of parameters of the locator.

www.sdmetrics.com