de.jaetzold.util
Interface Range

All Known Implementing Classes:
ComplementRange, DifferenceRange, SingleRange, CombinedRange, IntersectionRange

public interface Range

A interface for classes that can check whether a specific primitive value is contained in some thing (typical a mathematical interval) or not. As opposed to the interface java.util.Set a Range is not required to be able to deliver a Set of Objects for each value that is considered to be in it.

See Also:
Set

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.
 

Method Detail

isCacheable

public boolean isCacheable()
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.
Returns:
true if this instance guarantees, that any further call to contains() with the same arguments returns the same result

contains

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