Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.further.jaudit
Class EnumeratedTypeMetric  view EnumeratedTypeMetric download EnumeratedTypeMetric.java

java.lang.Object
  extended bycom.further.jaudit.EnumeratedTypeMetric
All Implemented Interfaces:
SourceMetric

public class EnumeratedTypeMetric
extends java.lang.Object
implements SourceMetric

An enumerated type metric is used to measure a source metric that has one of many values, and whose values are typically ranked from 1 to N. These values are strings like "Good", "Better", "Best" where a satisfactory value would be at least "Better". The exact type strings for the enumerated type are user defined, along with the name and abbreviation.

Since:
1.0
Version:
$Id: EnumeratedTypeMetric.java,v 1.1.1.1 2001/10/11 16:42:06 krisw Exp $

Field Summary
private  java.lang.String currentValue
          The current string value of the metric, which must appear in the possible values set
private  java.lang.String metricAbbreviation
          The metric abbreviation, like "PERQ"
private  java.lang.String metricDescription
          The metric description, like "The perceived quality of the source, according to the viewer"
private  java.lang.String metricName
          The metric name, like "Perceived Quality"
private  java.util.List possibleValues
          The possible values for the metric, in order.
private  java.lang.String requiredValue
          The required value for the enumerated type.
 
Constructor Summary
EnumeratedTypeMetric(java.lang.String name, java.lang.String abbreviation, java.lang.String description, java.util.List values, java.lang.String requiredValue)
          Create a new EnumeratedTypeMetric with the given name, abbreviation, list of possible values and required value.
 
Method Summary
 void accept(SourceMetricVisitor visitor)
          Accept the given SourceMetricVisitor, calling back to the appropriate visitMetric() method on the visitor.
 java.lang.String getDescription()
          Get the description for the metric, in a verbose fashion suitable to explain to a new user what the metric is rating.
 java.lang.String getMetricAbbreviation()
          Fetch the metric abbreviation for the current metric.
 java.lang.String getMetricName()
          Retreive the metric name for this particular metric.
 java.lang.String getMetricValue()
          Get the current metric value, which will be one of the possible metric values for the enumerated type.
 java.util.List getPossibleValues()
          Get the possible values for the enumerated type metric.
 boolean hasSatisfactoryValue()
          Does the given metric meet the minimum value for the given metric type? This allows a fast evaluation of whether or not the metric "passes", and can be used to flag a file that needs modification.
 void setMetricValue(java.lang.String value)
          Set the metric value to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metricName

private java.lang.String metricName
The metric name, like "Perceived Quality"


metricAbbreviation

private java.lang.String metricAbbreviation
The metric abbreviation, like "PERQ"


metricDescription

private java.lang.String metricDescription
The metric description, like "The perceived quality of the source, according to the viewer"


currentValue

private java.lang.String currentValue
The current string value of the metric, which must appear in the possible values set


possibleValues

private java.util.List possibleValues
The possible values for the metric, in order. The element in this list at position 0 is the highest ranked value for the enumeration, and the element at position N is the lowest ranked value.


requiredValue

private java.lang.String requiredValue
The required value for the enumerated type. If the current value of the metric is at a position that is numerically less than or equal to the position of this value in the possible value list, then the metric has an acceptable value

Constructor Detail

EnumeratedTypeMetric

public EnumeratedTypeMetric(java.lang.String name,
                            java.lang.String abbreviation,
                            java.lang.String description,
                            java.util.List values,
                            java.lang.String requiredValue)
Create a new EnumeratedTypeMetric with the given name, abbreviation, list of possible values and required value.

Method Detail

getPossibleValues

public java.util.List getPossibleValues()
Get the possible values for the enumerated type metric. These are the displayable strings that can be set as the metric values.


hasSatisfactoryValue

public boolean hasSatisfactoryValue()
Does the given metric meet the minimum value for the given metric type? This allows a fast evaluation of whether or not the metric "passes", and can be used to flag a file that needs modification.

Specified by:
hasSatisfactoryValue in interface SourceMetric

setMetricValue

public void setMetricValue(java.lang.String value)
Set the metric value to the given value. This checks to ensure that the specified value is a value enumerated type value.


getMetricValue

public java.lang.String getMetricValue()
Get the current metric value, which will be one of the possible metric values for the enumerated type.


getMetricName

public java.lang.String getMetricName()
Retreive the metric name for this particular metric. This is a descriptive tag, like "Coherance" or "Code Quality".

Specified by:
getMetricName in interface SourceMetric

getDescription

public java.lang.String getDescription()
Get the description for the metric, in a verbose fashion suitable to explain to a new user what the metric is rating.

Specified by:
getDescription in interface SourceMetric

getMetricAbbreviation

public java.lang.String getMetricAbbreviation()
Fetch the metric abbreviation for the current metric. This is something like "COH" or "COQ". This should be recognizable by the user, and is used when screen real estate is at a premium, such as in history lists.

Specified by:
getMetricAbbreviation in interface SourceMetric

accept

public void accept(SourceMetricVisitor visitor)
Accept the given SourceMetricVisitor, calling back to the appropriate visitMetric() method on the visitor.

Specified by:
accept in interface SourceMetric