org.openstreetmap.josm.gui.mappaint
Class Range

java.lang.Object
  extended by org.openstreetmap.josm.gui.mappaint.Range

public class Range
extends java.lang.Object

An interval of the form "lower < x <= upper" where 0 <= lower < upper. (upper can be Double.POSITIVE_INFINITY) immutable class


Field Summary
private  double lower
           
private  double upper
           
 
Constructor Summary
Range()
           
Range(double lower, double upper)
           
 
Method Summary
 boolean contains(double x)
           
static Range cut(Range a, Range b)
          provides the intersection of 2 overlapping ranges
 double getLower()
           
 double getUpper()
           
 Range reduceAround(double x, Range other)
          under the premise, that x is within this range, and not within the other range, it shrinks this range in a way to exclude the other range, but still contain x.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lower

private double lower

upper

private double upper
Constructor Detail

Range

public Range()

Range

public Range(double lower,
             double upper)
Method Detail

contains

public boolean contains(double x)

cut

public static Range cut(Range a,
                        Range b)
provides the intersection of 2 overlapping ranges


reduceAround

public Range reduceAround(double x,
                          Range other)
under the premise, that x is within this range, and not within the other range, it shrinks this range in a way to exclude the other range, but still contain x. x | this (------------------------------] other (-------] or (-----------------] result (----------------]


getLower

public double getLower()

getUpper

public double getUpper()

toString

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


JOSM