metricsOverlay.model.metrics
Class DerivedMetric

java.lang.Object
  extended by metricsOverlay.model.metrics.Metric
      extended by metricsOverlay.model.metrics.DerivedMetric
All Implemented Interfaces:
java.lang.Comparable<Metric>, IEditable, INameable

public class DerivedMetric
extends Metric

This class represents a derived form of metric to allow displays to use the same metric sections. Note: It has been decided to only allow composition from ActualMetric objects. This is because the process of wrapping adds no additional functionality.

Version:
15/8/2009
Author:
Matthew Harward

Constructor Summary
DerivedMetric(java.lang.String name, ActualMetric met)
          Reduced constructor.
DerivedMetric(java.lang.String name, Range range, ActualMetric met)
          Main constructor.
 
Method Summary
 boolean canChangeEditableStatus()
           
 boolean canEdit()
           
 java.lang.String derivedFrom()
           
 java.util.Set<MetricSection> getMetricSections()
           
 int numSections()
           
 void setEditable(boolean editable)
          If allowed, this sets the new editable status.
 
Methods inherited from class metricsOverlay.model.metrics.Metric
compareTo, getName, getRange, setName, setRange
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerivedMetric

public DerivedMetric(java.lang.String name,
                     ActualMetric met)
Reduced constructor. Sets up a default integer range.

Parameters:
name - the unique name of this metric.
met - the metric object that this one is derived from.

DerivedMetric

public DerivedMetric(java.lang.String name,
                     Range range,
                     ActualMetric met)
Main constructor.

Parameters:
name - the unique name of the metric
range - the range to be used
met - the metric from whence this metric's data is derived.
Method Detail

getMetricSections

public java.util.Set<MetricSection> getMetricSections()
Specified by:
getMetricSections in class Metric
Returns:
An unmodifiable set of MetricSections

numSections

public int numSections()
Returns:
The number of MetricSections associated with this mapping

derivedFrom

public java.lang.String derivedFrom()
Returns:
The name of the metric this is derived from.

canChangeEditableStatus

public boolean canChangeEditableStatus()
Returns:
A value to determine if the editable status may be changed.

canEdit

public boolean canEdit()
Returns:
A boolean value that determines if you are allowed to edit this class.

setEditable

public void setEditable(boolean editable)
Description copied from interface: IEditable
If allowed, this sets the new editable status.

Parameters:
editable - the new status.