T
- Data type of the coordinates.public class PointND<T extends java.lang.Number>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
X
Constant for accessing x-coordinate.
|
static int |
Y
Constant for accessing y-coordinate.
|
static int |
Z
Constant for accessing z-coordinate.
|
Constructor and Description |
---|
PointND(T... coordinates)
Constructor that initializes the point with a list of coordinates.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
T |
get(int dimension)
Returns the value of a specified dimension.
|
int |
getDimensions()
Returns the number of dimensions.
|
java.awt.geom.Point2D |
getPoint2D()
Creates a two-dimensional point from dimensions 0 and 1.
|
java.awt.geom.Point2D |
getPoint2D(int dimX,
int dimY)
Creates a two-dimensional point from the specified dimensions.
|
int |
hashCode() |
void |
set(int dimension,
T coordinate)
Sets the value of a specified dimension.
|
void |
setLocation(T... coordinates)
Sets all coordinate values at once.
|
java.lang.String |
toString() |
public static final int X
public static final int Y
public static final int Z
public PointND(T... coordinates)
coordinates
- Coordinate values.public int getDimensions()
public T get(int dimension)
dimension
- Dimension.public void set(int dimension, T coordinate)
dimension
- Dimension.coordinate
- New coordinate value.public void setLocation(T... coordinates)
coordinates
- Coordinate values.public java.awt.geom.Point2D getPoint2D(int dimX, int dimY)
dimX
- Dimension for x coordinate.dimY
- Dimension for y coordinate.public java.awt.geom.Point2D getPoint2D()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object