public class Box<P extends Position> extends Object
A Box determines a sub characterised by a lower-left and an upper-right coordinate.
An Box is empty if the set of enclosed points are emptym, and has Double.NaN for its lowerleft/upperright coordinates.
| Constructor and Description |
|---|
Box(CoordinateReferenceSystem<P> crs)
Creates an empty Box
|
Box(P lowerLeft,
P upperRight,
CoordinateReferenceSystem<P> crs)
Creates an instance from specified lower-left and upper-right
Points. |
| Modifier and Type | Method and Description |
|---|---|
<Q extends Position> |
as(Class<Q> castToType) |
boolean |
contains(Box other)
Checks whether this
Box contains the specifies Box. |
boolean |
contains(P p)
Checks whether this
Box contains the specifies Position. |
boolean |
equals(Object o) |
int |
getCoordinateDimension() |
CoordinateReferenceSystem<P> |
getCoordinateReferenceSystem()
Returns the
CoordinateReferenceSystem for this Box |
int |
hashCode() |
Box<P> |
intersect(Box<P> other)
Intersects the specified
Box with this Box and returns the result. |
boolean |
intersects(Box<P> other)
Checks whether this
Box intersects the specifies Box. |
boolean |
isEmpty()
Checks whether this
Box is empty. |
P |
lowerLeft()
Returns the lower-left point of this
Box. |
static <P extends Position> |
mkEmpty(CoordinateReferenceSystem<P> crs) |
String |
toString() |
Box<P> |
union(Box<P> other)
Creates an
Box that is the set-theoretic union of this Box with the specified Box |
P |
upperRight()
Returns the upper-right point of this
Box. |
boolean |
within(Box<P> other)
Checks whether this
Box is contained within the specified Box |
public Box(CoordinateReferenceSystem<P> crs)
public Box(P lowerLeft, P upperRight, CoordinateReferenceSystem<P> crs)
Points.lowerLeft - the Point designating the lower-left coordinatesupperRight - the Point designating the upper-right coordinates
of the envelope.public CoordinateReferenceSystem<P> getCoordinateReferenceSystem()
CoordinateReferenceSystem for this Boxpublic P lowerLeft()
Box.public P upperRight()
Box.public Box<P> union(Box<P> other)
Box that is the set-theoretic union of this Box with the specified Boxother - other BoxBox that encompasses both operands.IllegalArgumentException - when the operand Boxs don't have the same coordinate reference system.public Box<P> intersect(Box<P> other)
Box with this Box and returns the result.other - the Box to intersect with this instanceIllegalArgumentException - when the specified Box doesn't have the same coordinate reference system as this instance.public static <P extends Position> Box<P> mkEmpty(CoordinateReferenceSystem<P> crs)
public int getCoordinateDimension()
public boolean isEmpty()
Box is empty.public boolean within(Box<P> other)
Box is contained within the specified Boxother - the other BoxBoxIllegalArgumentException - when the specified Box doesn't have the same coordinate reference system as this instance.public boolean contains(Box other)
Box contains the specifies Box.other - the other BoxBoxIllegalArgumentException - when the specified Box doesn't have the same coordinate reference system as this instance.public boolean contains(P p)
Box contains the specifies Position.p - the PositionPositionIllegalArgumentException - when the specified Point doesn't have the same coordinate reference system as this instance.public boolean intersects(Box<P> other)
Box intersects the specifies Box.
Two instances intersect when their set-theoretic intersection is non-empty.
other - the other BoxBoxIllegalArgumentException - when the specified Box doesn't have the same coordinate reference system as this instance.Copyright © 2021 geolatte.org. All rights reserved.