jumbo.euclid
Class Int2Range

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

public class Int2Range
extends Status

Int2Range - 2-D int limits

Contains two IntRanges. 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 IntRange components. Adding points will create valid ranges.


Constructor Summary
Int2Range()
           
Int2Range(Int2Range r)
          copy constructor
Int2Range(IntRange xr, IntRange yr)
          initialise with min and max values;
 
Method Summary
 void add(Int2 p)
          add a Int2 to a range
 boolean equals(Int2Range r2)
           
 IntRange getXRange()
          get xrange
 IntRange getYRange()
          get yrange
 boolean includes(Int2 p)
          is an Int2 within a Int2Range?
 boolean includes(Int2Range r)
          is one Int2Range completely within another?
 Int2Range intersectionWith(Int2Range 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 Int2Range is valid if both its constituent ranges are
 Int2Range plus(Int2Range 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

Int2Range

public Int2Range()

Int2Range

public Int2Range(IntRange xr,
                 IntRange yr)
initialise with min and max values;

Int2Range

public Int2Range(Int2Range r)
copy constructor
Method Detail

isValid

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

equals

public boolean equals(Int2Range r2)

plus

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

intersectionWith

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

getXRange

public IntRange getXRange()
get xrange

getYRange

public IntRange getYRange()
get yrange

includes

public boolean includes(Int2 p)
is an Int2 within a Int2Range?

includes

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

add

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

toString

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