public class Int2Range extends Object implements EuclidConstants
Default is two default/invalid IntRange components. Adding points will create valid ranges.
C_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
Int2Range()
creates zero range.
|
Int2Range(Int2Range r)
copy constructor
|
Int2Range(IntRange xr,
IntRange yr)
initialise with min and max values;
|
Int2Range(Real2Range r)
copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Int2 p)
add a Int2 to a range
|
boolean |
equals(Object o) |
Int2Range |
getInt2RangeExtendedInX(int leftSide,
int rightSide)
extends XRange.
|
Int2Range |
getInt2RangeExtendedInY(int topExtend,
int bottomExtend)
extends XRange.
|
IntRange |
getXRange()
get xrange
|
IntRange |
getYRange()
get yrange
|
int |
hashCode() |
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 |
isEqualTo(Int2Range r2)
is equal to.
|
boolean |
isValid()
a Int2Range is valid if both its constituent ranges are
|
Int2Range |
plus(Int2Range r2)
merge two ranges and take the maximum extents
|
String |
toString()
to string.
|
boolean |
touches(Int2Range bbox)
do two boxes touch?
if box a extends to x and box b extends from x+1 they are touching.
|
public Int2Range()
public Int2Range(IntRange xr, IntRange yr)
xr - X-rangeyr - Y-rangepublic Int2Range(Int2Range r)
r - the IntRange object to be copiedpublic Int2Range(Real2Range r)
r - the IntRange object to be copiedpublic boolean isValid()
public boolean isEqualTo(Int2Range r2)
r2 - the intRange to be compared with this intRangepublic Int2Range plus(Int2Range r2)
r2 - the intRange to be added with this intRangepublic Int2Range intersectionWith(Int2Range r2)
r2 - public IntRange getXRange()
public IntRange getYRange()
public Int2Range getInt2RangeExtendedInX(int leftSide, int rightSide)
leftSide - rightSide - public Int2Range getInt2RangeExtendedInY(int topExtend, int bottomExtend)
topExtend - bottomExtend - public boolean includes(Int2 p)
p - public boolean includes(Int2Range r)
r - public void add(Int2 p)
p - public boolean touches(Int2Range bbox)
bbox - Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.