public class Coordinate extends Object implements Comparable<Coordinate>, Serializable
| Constructor and Description |
|---|
Coordinate(Number y,
Number x) |
| Modifier and Type | Method and Description |
|---|---|
Point2D |
asPoint()
Method to translate this
Coordinate to a Point2D. |
int |
compareTo(Coordinate that) |
boolean |
equals(Object object) |
int |
getX() |
int |
getY() |
int |
hashCode() |
static SortedSet<Coordinate> |
range(Coordinate min,
Coordinate max)
Static method to return a
SortedSet of Coordinates
specified by the parameters. |
static SortedSet<Coordinate> |
range(int y0,
int x0,
int yN,
int xN)
Static method to return a
SortedSet of Coordinates
specified by the parameters. |
String |
toString() |
Coordinate |
translate(Coordinate ds)
|
Coordinate |
translate(Number dy,
Number dx)
|
boolean |
within(Coordinate min,
Coordinate max)
|
@ConstructorProperties(value={"y","x"}) public Coordinate(Number y, Number x)
y - The Y-coordinate.x - The X-coordinate.public int getY()
public int getX()
public Coordinate translate(Number dy, Number dx)
dy - The change in Y-coordinate.dx - The change in X-coordinate.Coordinate.public Coordinate translate(Coordinate ds)
ds - The Coordinate describing the change.Coordinate.public boolean within(Coordinate min, Coordinate max)
min - The minimum Coordinate.max - The maximum Coordinate.true if within the area; false otherwise.public Point2D asPoint()
Coordinate to a Point2D.Point.public int compareTo(Coordinate that)
compareTo in interface Comparable<Coordinate>public static SortedSet<Coordinate> range(Coordinate min, Coordinate max)
SortedSet of Coordinates
specified by the parameters.min - [y0, x0]max - [yN, xN]SortedSet of Coordinates.public static SortedSet<Coordinate> range(int y0, int x0, int yN, int xN)
SortedSet of Coordinates
specified by the parameters.y0 - MIN(y)x0 - MIN(x)yN - MAX(y) + 1xN - MAX(x) + 1SortedSet of Coordinates.Copyright © 2015–2020 Allen D. Ball. All rights reserved.