jumbo.euclid
Class Real2Range

java.lang.Object
  |
  +--jumbo.euclid.Status
        |
        +--jumbo.euclid.Real2Range

public class Real2Range
extends Status

Real2Range - 2-D double limits

Contains two RealRanges. Can therefore be used to describe 2-dimensional limits (e.g. axes of graphs, rectangles in graphics, limits of a molecule, etc.)

Default is two default/invalid RealRange components. Adding points will create valid ranges.


Constructor Summary
Real2Range()
           
Real2Range(Real2Range r)
          copy constructor
Real2Range(RealRange xr, RealRange yr)
          initialise with min and max values;
 
Method Summary
 void add(Real2 p)
          add a Real2 to a range
 boolean equals(Real2Range r2)
           
 RealRange getXRange()
          get xrange
 RealRange getYRange()
          get yrange
 boolean includes(Real2 p)
          is an Real2 within a Real2Range?
 boolean includes(Real2Range r)
          is one Real2Range completely within another?
 Real2Range intersectionWith(Real2Range r2)
          intersect two ranges and take the range common to both; return invalid range if no overlap or either is null/invalid
 boolean isValid()
          a Real2Range is valid if both its constituent ranges are
 Real2Range plus(Real2Range r2)
          merge two ranges and take the maximum extents
 java.lang.String toString()
           
 
Methods inherited from class jumbo.euclid.Status
NYI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Real2Range

public Real2Range()

Real2Range

public Real2Range(RealRange xr,
                  RealRange yr)
initialise with min and max values;

Real2Range

public Real2Range(Real2Range r)
copy constructor
Method Detail

isValid

public boolean isValid()
a Real2Range is valid if both its constituent ranges are

equals

public boolean equals(Real2Range r2)

plus

public Real2Range plus(Real2Range r2)
merge two ranges and take the maximum extents

intersectionWith

public Real2Range intersectionWith(Real2Range r2)
intersect two ranges and take the range common to both; return invalid range if no overlap or either is null/invalid

getXRange

public RealRange getXRange()
get xrange

getYRange

public RealRange getYRange()
get yrange

includes

public boolean includes(Real2 p)
is an Real2 within a Real2Range?

includes

public boolean includes(Real2Range r)
is one Real2Range completely within another?

add

public void add(Real2 p)
add a Real2 to a range

toString

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