com.infoengine.schema
Class Range

java.lang.Object
  extended bycom.infoengine.schema.Range
All Implemented Interfaces:
Serializable

public class Range
extends Object
implements Serializable

Represents a numeric range constraint attached to a SimpleType

min and max properties are stored as double since all less specific base numeric data types constraints can be derived from it. Convenience methods are supplied to retrieve min and max as; double, int, short, float and long.

A range may be inclusive or exclusive. Both ends of the range must be inclusive or exclusive. It is not possible to have an inclusive lower bound and exclusive upper bound as the same effect can be achieved by simply altering either bound by a value of one.

See Also:
SimpleType, Serialized Form

Field Summary
private  boolean isExclusive
           
private  boolean isInclusive
           
private  Double max
           
private  Double min
           
 
Constructor Summary
Range()
          Create a new inclusive range with min and max of zero.
Range(double min, double max)
          Create a new inclusive range with values of min and max.
 
Method Summary
 double doubleMax()
          Get the max property as a double
 double doubleMin()
          Get the min property as a double
 float floatMax()
          Get the max property as a float
 float floatMin()
          Get the min property as a float
 boolean getIsExclusive()
          Get the isExclusive property value
 boolean getIsInclusive()
          Get the isInclusive property value
 double getMax()
          Get the max property value
 double getMin()
          Get the min property value
 int intMax()
          Get the max property as an int
 int intMin()
          Get the min property as an int
 boolean isExclusive()
          Get the isExclusive property value
 boolean isInclusive()
          Get the isInclusive property value
 long longMax()
          Get the max property as a long
 long longMin()
          Get the min property as a long
 void setIsExclusive(boolean b)
          Set the isExclusive property value.
 void setIsInclusive(boolean b)
          Set the isInclusive property value.
 void setMax(double d)
          Set the max property
 void setMin(double d)
          Set the min property
 short shortMax()
          Get the max property as a short
 short shortMin()
          Get the min property as a short
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

min

private Double min

max

private Double max

isInclusive

private boolean isInclusive

isExclusive

private boolean isExclusive
Constructor Detail

Range

public Range()
Create a new inclusive range with min and max of zero.


Range

public Range(double min,
             double max)
Create a new inclusive range with values of min and max.

Method Detail

setMin

public void setMin(double d)
Set the min property

Parameters:
d - the new property value

getMin

public double getMin()
Get the min property value

Returns:
the property value

setMax

public void setMax(double d)
Set the max property

Parameters:
d - the new property value

getMax

public double getMax()
Get the max property value

Returns:
the property value

setIsInclusive

public void setIsInclusive(boolean b)
Set the isInclusive property value. Since a range may only be inclusive or exclusive this also affects the isExclusive property value.

Parameters:
b - the new property value

getIsInclusive

public boolean getIsInclusive()
Get the isInclusive property value

Returns:
the property value

isInclusive

public boolean isInclusive()
Get the isInclusive property value

Returns:
the property value

setIsExclusive

public void setIsExclusive(boolean b)
Set the isExclusive property value. Since a range may only be inclusive or exclusive this also affects the isInclusive property value.

Parameters:
b - the new property value

getIsExclusive

public boolean getIsExclusive()
Get the isExclusive property value

Returns:
the property value

isExclusive

public boolean isExclusive()
Get the isExclusive property value

Returns:
the property value

doubleMin

public double doubleMin()
Get the min property as a double

Returns:
the property value

doubleMax

public double doubleMax()
Get the max property as a double

Returns:
the property value

intMin

public int intMin()
Get the min property as an int

Returns:
the property value

intMax

public int intMax()
Get the max property as an int

Returns:
the property value

floatMin

public float floatMin()
Get the min property as a float

Returns:
the property value

floatMax

public float floatMax()
Get the max property as a float

Returns:
the property value

shortMin

public short shortMin()
Get the min property as a short

Returns:
the property value

shortMax

public short shortMax()
Get the max property as a short

Returns:
the property value

longMin

public long longMin()
Get the min property as a long

Returns:
the property value

longMax

public long longMax()
Get the max property as a long

Returns:
the property value