org.simantics.databoard.util
Class Range

java.lang.Object
  extended by org.simantics.databoard.util.Range

public class Range
extends java.lang.Object

Number range. Examples: Inclusive "[0..100]" Exclusive "[0..100)" Unlimited "[..]" No upper limit "[0..)" No lower limit "(..0]" Exact value "0" Exclude all "()" Inclusive "[0.5..100.5]" Exclusive "[0.5..100.5)" Unlimited "[..]" No upper limit "[0.5..)" No lower limit "(..0.5]" Exact value "[0.5]" Inclusive "[0e..100]" Exclusive "[0..100)" Unlimited "" No upper limit "[0..)" No lower limit "(..0]" Exact value "0"

Author:
Toni Kalajainen

Constructor Summary
Range(Limit lower, Limit upper)
           
 
Method Summary
static Range between(Limit limit1, Limit limit2)
           
 boolean contains(java.lang.Number value)
           
static Range create(java.lang.Byte exact)
           
static Range create(java.lang.Byte lower, java.lang.Byte upper, boolean lowerInclusive, boolean upperInclusive)
           
static Range create(java.lang.Double exact)
           
static Range create(java.lang.Double lower, java.lang.Double upper, boolean lowerInclusive, boolean upperInclusive)
           
static Range create(java.lang.Float exact)
           
static Range create(java.lang.Float lower, java.lang.Float upper, boolean lowerInclusive, boolean upperInclusive)
           
static Range create(java.lang.Integer exact)
           
static Range create(java.lang.Integer lower, java.lang.Integer upper, boolean lowerInclusive, boolean upperInclusive)
           
static Range create(java.lang.Long exact)
           
static Range create(java.lang.Long lower, java.lang.Long upper, boolean lowerInclusive, boolean upperInclusive)
           
 boolean equals(java.lang.Object obj)
           
static Range excludeAll()
           
 Limit getLower()
           
 Limit getUpper()
           
 int hashCode()
           
static Range includeAll()
           
 java.lang.String toString()
           
static Range valueOf(java.lang.String txt)
           
static Range valueOfUnchecked(java.lang.String txt)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range(Limit lower,
             Limit upper)
Method Detail

create

public static Range create(java.lang.Byte lower,
                           java.lang.Byte upper,
                           boolean lowerInclusive,
                           boolean upperInclusive)

create

public static Range create(java.lang.Integer lower,
                           java.lang.Integer upper,
                           boolean lowerInclusive,
                           boolean upperInclusive)

create

public static Range create(java.lang.Long lower,
                           java.lang.Long upper,
                           boolean lowerInclusive,
                           boolean upperInclusive)

create

public static Range create(java.lang.Float lower,
                           java.lang.Float upper,
                           boolean lowerInclusive,
                           boolean upperInclusive)

create

public static Range create(java.lang.Double lower,
                           java.lang.Double upper,
                           boolean lowerInclusive,
                           boolean upperInclusive)

create

public static Range create(java.lang.Byte exact)

create

public static Range create(java.lang.Integer exact)

create

public static Range create(java.lang.Long exact)

create

public static Range create(java.lang.Float exact)

create

public static Range create(java.lang.Double exact)

includeAll

public static Range includeAll()

excludeAll

public static Range excludeAll()

between

public static Range between(Limit limit1,
                            Limit limit2)

getLower

public Limit getLower()

getUpper

public Limit getUpper()

toString

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

valueOfUnchecked

public static Range valueOfUnchecked(java.lang.String txt)

valueOf

public static Range valueOf(java.lang.String txt)
                     throws RangeException
Throws:
RangeException

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

contains

public boolean contains(java.lang.Number value)