public class Polygon extends Area implements Iterable<Position>
| Modifier and Type | Field and Description |
|---|---|
static MessageSerializer<Polygon> |
SERIALIZER
The serializer of the polygon.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Position position) |
static Polygon |
create(Position... positions) |
Rectangle |
getBoundingBox()
Returns a bounding box of the area.
|
List<Position> |
getPoints() |
Position |
getRandomPosition(Random random)
Returns a random position within the area using a specified random source.
|
Polygon |
immutable()
Returns an immutable copy of this message.
|
boolean |
intersects(Area other) |
Iterator<Position> |
iterator() |
contains, fromJSON, getRandomPosition, toJSON, unionOf, unionWithclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final MessageSerializer<Polygon> SERIALIZER
public Polygon(Position... positions)
public Rectangle getBoundingBox()
getBoundingBox in class Areapublic Position getRandomPosition(Random random)
getRandomPosition in class Arearandom - the random sourcepublic Polygon immutable()
public boolean intersects(Area other)
intersects in class AreaCopyright © 2012–2015 Danish Maritime Authority. All rights reserved.