simtools.ui
Class GenericMapper.Interval

java.lang.Object
  extended by simtools.ui.GenericMapper.Interval
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Enclosing class:
GenericMapper

public static class GenericMapper.Interval
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Associate a value for a data interval. The data interval can be of type double, long, or String, and the comparison will use the best possible conversion. Ex: you can specify an interval 0xABCDEF0123456789 < x < 0xABCDEF0123456791 and 0xABCDEF0123456790 will match (which would not be possible with the precision of "double" data)

See Also:
Serialized Form

Field Summary
protected  boolean boundedMax
           
protected  boolean boundedMin
           
protected  double dmax
           
protected  double dmin
           
protected  boolean infiniteMax
           
protected  boolean infiniteMin
           
protected  long lmax
           
protected  long lmin
           
protected  java.lang.String smax
           
protected  java.lang.String smin
           
protected  int type
           
 java.lang.Object value
          The value associated with this interval
 
Constructor Summary
GenericMapper.Interval(boolean isMore, double v, boolean bounded, java.lang.Object value)
          Creates an interval of "double" data with a simple bound
GenericMapper.Interval(boolean isMore, long v, boolean bounded, java.lang.Object value)
          Creates an interval of "long" data with a simple bound
GenericMapper.Interval(boolean isMore, java.lang.String v, boolean bounded, java.lang.Object value)
          Creates an interval of "String" data with a simple bound
GenericMapper.Interval(double min, boolean boundedMin, double max, boolean boundedMax, java.lang.Object value)
           
GenericMapper.Interval(long min, boolean boundedMin, long max, boolean boundedMax, java.lang.Object value)
           
GenericMapper.Interval(java.lang.Object value)
          Creates a degenarated interval always including any value
GenericMapper.Interval(java.lang.String min, boolean boundedMin, java.lang.String max, boolean boundedMax, java.lang.Object value)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(double value)
           
 boolean contains(long value)
           
 boolean contains(java.lang.String value)
           
 java.lang.Number getMax()
           
 java.lang.Number getMin()
           
 java.lang.Object getValue()
           
 boolean isBoundedMax()
           
 boolean isBoundedMin()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected int type

dmin

protected double dmin

dmax

protected double dmax

lmin

protected long lmin

lmax

protected long lmax

smin

protected java.lang.String smin

smax

protected java.lang.String smax

boundedMin

protected boolean boundedMin

boundedMax

protected boolean boundedMax

infiniteMin

protected boolean infiniteMin

infiniteMax

protected boolean infiniteMax

value

public java.lang.Object value
The value associated with this interval

Constructor Detail

GenericMapper.Interval

public GenericMapper.Interval(boolean isMore,
                              double v,
                              boolean bounded,
                              java.lang.Object value)
Creates an interval of "double" data with a simple bound

Parameters:
isMore - Values in the interval are greater than the v argument
v - The value to consider as the interval limit
bounded - If the value itself is in the interval
value - The value to associate with this interval

GenericMapper.Interval

public GenericMapper.Interval(double min,
                              boolean boundedMin,
                              double max,
                              boolean boundedMax,
                              java.lang.Object value)

GenericMapper.Interval

public GenericMapper.Interval(boolean isMore,
                              long v,
                              boolean bounded,
                              java.lang.Object value)
Creates an interval of "long" data with a simple bound

Parameters:
isMore - Values in the interval are greater than the v argument
v - The value to consider as the interval limit
bounded - If the value itself is in the interval
value - The value to associate with this interval

GenericMapper.Interval

public GenericMapper.Interval(long min,
                              boolean boundedMin,
                              long max,
                              boolean boundedMax,
                              java.lang.Object value)

GenericMapper.Interval

public GenericMapper.Interval(boolean isMore,
                              java.lang.String v,
                              boolean bounded,
                              java.lang.Object value)
Creates an interval of "String" data with a simple bound

Parameters:
isMore - Values in the interval are greater than the v argument
v - The value to consider as the interval limit
bounded - If the value itself is in the interval
value - The value to associate with this interval

GenericMapper.Interval

public GenericMapper.Interval(java.lang.String min,
                              boolean boundedMin,
                              java.lang.String max,
                              boolean boundedMax,
                              java.lang.Object value)

GenericMapper.Interval

public GenericMapper.Interval(java.lang.Object value)
Creates a degenarated interval always including any value

Method Detail

contains

public boolean contains(double value)

contains

public boolean contains(long value)

contains

public boolean contains(java.lang.String value)

toString

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

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getMin

public java.lang.Number getMin()
                        throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

getMax

public java.lang.Number getMax()
                        throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

isBoundedMin

public boolean isBoundedMin()

isBoundedMax

public boolean isBoundedMax()

getValue

public java.lang.Object getValue()