metricsOverlay.model.metrics
Class OrderedNominalRange

java.lang.Object
  extended by metricsOverlay.model.metrics.Range
      extended by metricsOverlay.model.metrics.MappedRange
          extended by metricsOverlay.model.metrics.OrderedNominalRange
All Implemented Interfaces:
java.lang.Comparable<Range>, ITyped

public class OrderedNominalRange
extends MappedRange

An ordered nominal range using a map. List must be size >= 1

Version:
15/8/2009
Author:
Matthew Harward

Constructor Summary
OrderedNominalRange()
           
OrderedNominalRange(java.util.Map<java.lang.Integer,java.lang.String> map)
           
 
Method Summary
 java.lang.String getMax()
           
 java.lang.String getMaxName()
          The name of the maximum value.
 java.lang.String getMin()
           
 java.lang.String getMinName()
          The name of the minimum value.
 int getNumItems()
          The number of different mappings avaliable.
 java.util.Map<java.lang.Integer,java.lang.String> getRangeMap()
          Returns the map containing the ranges within this range.
 java.lang.String getType()
           
 boolean isInRange(java.lang.String value)
           
 boolean isInRangeName(java.lang.String value)
          Returns if the name is contained as a mapping.
 boolean isValid()
          Determines if the set range is valid.
 
Methods inherited from class metricsOverlay.model.metrics.MappedRange
toString
 
Methods inherited from class metricsOverlay.model.metrics.Range
compareTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderedNominalRange

public OrderedNominalRange()

OrderedNominalRange

public OrderedNominalRange(java.util.Map<java.lang.Integer,java.lang.String> map)
Method Detail

getMax

public java.lang.String getMax()
Specified by:
getMax in class Range
Returns:
Abstract method, should be overriden to give a String representation of this range's max value.

getMin

public java.lang.String getMin()
Specified by:
getMin in class Range
Returns:
Abstract method, should be overriden to give a String representation of this range's min value.

getMinName

public java.lang.String getMinName()
Description copied from class: MappedRange
The name of the minimum value.

Specified by:
getMinName in class MappedRange
Returns:
the name.

getMaxName

public java.lang.String getMaxName()
Description copied from class: MappedRange
The name of the maximum value.

Specified by:
getMaxName in class MappedRange
Returns:
the name.

isInRange

public boolean isInRange(java.lang.String value)
Specified by:
isInRange in class Range
Returns:
Abstract method, should be overriden to detect if a provided string value is within the required range.

isInRangeName

public boolean isInRangeName(java.lang.String value)
Description copied from class: MappedRange
Returns if the name is contained as a mapping.

Specified by:
isInRangeName in class MappedRange
Parameters:
value - the name.
Returns:
true if the value was found, else false.

getType

public java.lang.String getType()
Specified by:
getType in interface ITyped
Specified by:
getType in class Range
Returns:
Abstract method, should be overriden to give a string representation of the name of the range type.

getRangeMap

public java.util.Map<java.lang.Integer,java.lang.String> getRangeMap()
Description copied from class: MappedRange
Returns the map containing the ranges within this range.

Specified by:
getRangeMap in class MappedRange
Returns:
the map.

getNumItems

public int getNumItems()
Description copied from class: MappedRange
The number of different mappings avaliable.

Specified by:
getNumItems in class MappedRange
Returns:
a count of the number of range mappings.

isValid

public boolean isValid()
Description copied from class: Range
Determines if the set range is valid.

Specified by:
isValid in class Range
Returns:
true if valid, else false.