de.jaetzold.util
Class SingleRange

java.lang.Object
  |
  +--de.jaetzold.util.SingleRange
All Implemented Interfaces:
Range

public class SingleRange
extends Object
implements Range

A class defining an intervall for numbers. A Range can be checked whether it contains a specific value or not.


Constructor Summary
SingleRange()
           
SingleRange(double threshold)
           
SingleRange(double lower, double upper)
           
SingleRange(double lower, double upper, boolean openLowerBorder, boolean openUpperBorder)
           
 
Method Summary
 boolean contains(double value)
          Tells whether the given value is in the Range or not.
 boolean isCacheable()
          Tells whether this instance will in the future produce the same result for the same arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleRange

public SingleRange()

SingleRange

public SingleRange(double threshold)

SingleRange

public SingleRange(double lower,
                   double upper)

SingleRange

public SingleRange(double lower,
                   double upper,
                   boolean openLowerBorder,
                   boolean openUpperBorder)
Method Detail

contains

public boolean contains(double value)
Tells whether the given value is in the Range or not.
Specified by:
contains in interface Range
Returns:
true, if the given value could be found inside the Range, false otherwise

isCacheable

public boolean isCacheable()
Description copied from interface: Range
Tells whether this instance will in the future produce the same result for the same arguments. This can be false first and then true at a later time, but it is not legal to return false here after a return of true in the past, because the true answer before was wrong then.
Specified by:
isCacheable in interface Range
Following copied from interface: de.jaetzold.util.Range
Returns:
true if this instance guarantees, that any further call to contains() with the same arguments returns the same result