edu.jhu.tmaj.beans.masks.color
Class SimpleRange

java.lang.Object
  extended by edu.jhu.tmaj.beans.masks.color.SimpleRange
All Implemented Interfaces:
java.io.Serializable

public final class SimpleRange
extends java.lang.Object
implements java.io.Serializable

Represents a range of values no smaller than MIN, and no larger than MAX. If the range includes nothing, the range is said to be RESET.

See Also:
Serialized Form

Method Summary
 void ensureRangeContains(int value)
          Expands this range if necessary to include the supplied value.
 boolean equals(java.lang.Object obj)
           
static SimpleRange getDefinedRange(int min, int max)
          Gets a defined (non-reset) range.
 int getMax()
           
 int getMin()
           
static SimpleRange getResetRange()
          Gets a reset range.
 int hashCode()
           
 boolean inRange(int value)
          Returns true if the value is inside this range.
 boolean isReset()
           
 void reset()
          Resets this range; a reset range includes NO values.
 void setRange(SimpleRange range)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getDefinedRange

public static SimpleRange getDefinedRange(int min,
                                          int max)
Gets a defined (non-reset) range.


getResetRange

public static SimpleRange getResetRange()
Gets a reset range.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMax

public int getMax()

getMin

public int getMin()

setRange

public void setRange(SimpleRange range)

ensureRangeContains

public void ensureRangeContains(int value)
Expands this range if necessary to include the supplied value.


reset

public void reset()
Resets this range; a reset range includes NO values.


isReset

public boolean isReset()

inRange

public boolean inRange(int value)
Returns true if the value is inside this range. If the range is reset, nothing is considered to be in that range.