public final class Rectangle extends Area
| Modifier and Type | Field and Description |
|---|---|
static Rectangle |
ALL
A bounding box encompassing all coordinates.
|
static MessageSerializer<Rectangle> |
SERIALIZER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double latitude,
double longitude) |
boolean |
contains(Position position) |
static Rectangle |
create(Position topLeft,
Position bottomRight) |
boolean |
equals(Object obj) |
static Rectangle |
fromJSON(CharSequence string)
Creates a message of this type from a JSON throwing a runtime exception if the format of the message does not
match.
|
Position |
getBottomLeft() |
Position |
getBottomRight() |
double |
getBottomRightLatitude() |
double |
getBottomRightLongitude() |
Rectangle |
getBoundingBox()
Returns a bounding box of the area.
|
Position |
getRandomPosition(Random r)
Returns a random position within the area using a specified random source.
|
Position |
getTopLeft() |
double |
getTopLeftLatitude() |
double |
getTopLeftLongitude() |
Position |
getTopRight() |
int |
hashCode() |
Rectangle |
immutable()
Returns an immutable copy of this message.
|
boolean |
intersects(Area other) |
boolean |
intersects(Circle other) |
boolean |
intersects(Rectangle other) |
String |
toString() |
public static final Rectangle ALL
public static final MessageSerializer<Rectangle> SERIALIZER
public boolean contains(double latitude,
double longitude)
public Position getBottomRight()
public Position getBottomLeft()
public double getBottomRightLatitude()
public double getBottomRightLongitude()
public Rectangle getBoundingBox()
getBoundingBox in class Areapublic Position getRandomPosition(Random r)
getRandomPosition in class Arear - the random sourcepublic Position getTopLeft()
public Position getTopRight()
public double getTopLeftLatitude()
public double getTopLeftLongitude()
public Rectangle immutable()
public boolean intersects(Area other)
intersects in class Areapublic boolean intersects(Circle other)
public boolean intersects(Rectangle other)
public static Rectangle fromJSON(CharSequence string)
string - the JSON string to parseCopyright © 2012–2015 Danish Maritime Authority. All rights reserved.