main
Class DisplayRanges

java.lang.Object
  extended by main.DisplayRanges

public class DisplayRanges
extends java.lang.Object

The DisplayRanges class contains an arbitrary number of ranges that specify how nodes and edges are drawn on the map. The ranges specify boundary values that define a numerical range. They can also specify how to draw invalid map components and map components that don't fit into any of the other ranges.


Field Summary
private  java.util.ArrayList<Range> ranges
           
 
Constructor Summary
DisplayRanges()
          Creates a new set of ranges, which is initially empty.
 
Method Summary
 void addRange(double low, double high, java.lang.Object value)
          Adds a new standard range with its associated value Object.
 void addRange(Range range)
          Adds the specified range to the list of ranges.
 java.util.ArrayList<Range> getRanges()
           
 java.lang.Object getValue(java.lang.Double weight)
          Returns the value that corresponds to the range in which the argument falls.
 java.util.Iterator<Range> iterator()
          Returns an iterator over the ranges.
private  void removeElseRange()
           
private  void removeInvalidRange()
           
 boolean removeRange(Range range)
          Removes the range that is identical to the argument range.
 void setElseValue(java.lang.Object value)
          Sets the value associated with valid components that do not fit into a standard range.
 void setInvalidValue(java.lang.Object value)
          Sets the value associated with invalid map components.
 java.lang.String toString()
          Returns a string representation of this DisplayRanges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ranges

private java.util.ArrayList<Range> ranges
Constructor Detail

DisplayRanges

public DisplayRanges()
Creates a new set of ranges, which is initially empty.

Method Detail

addRange

public void addRange(double low,
                     double high,
                     java.lang.Object value)
Adds a new standard range with its associated value Object.

Parameters:
low - a double that defines the lower boundary of the range. Weights equal to this parameter are considered to be in the range.
high - a double that defines the upper boundary of the range. Weights equal to this parameter are not considered to be in the range.
value - the Object that specifies how components in this range should be drawn

addRange

public void addRange(Range range)
Adds the specified range to the list of ranges.

Parameters:
range - the Range to add

setInvalidValue

public void setInvalidValue(java.lang.Object value)
Sets the value associated with invalid map components.

Parameters:
value - an Object

setElseValue

public void setElseValue(java.lang.Object value)
Sets the value associated with valid components that do not fit into a standard range.

Parameters:
value - an Object

removeInvalidRange

private void removeInvalidRange()

removeElseRange

private void removeElseRange()

getValue

public java.lang.Object getValue(java.lang.Double weight)
Returns the value that corresponds to the range in which the argument falls.

Parameters:
weight - a Double representing the weight of a map component
Returns:
the value corresponding to the range in which the weight falls

removeRange

public boolean removeRange(Range range)
Removes the range that is identical to the argument range.

Parameters:
range - the Range to remove
Returns:
true if the range was in the list of ranges; false otherwise

iterator

public java.util.Iterator<Range> iterator()
Returns an iterator over the ranges.

Returns:
an Iterator over the ranges

toString

public java.lang.String toString()
Returns a string representation of this DisplayRanges. This is for debugging purposes.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this DisplayRanges

getRanges

public java.util.ArrayList<Range> getRanges()