|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.erichseifert.gral.util.PointND<T>
T
- Data type of the coordinates.public class PointND<T extends Number>
Class for storing n-dimensional points.
Field Summary | |
---|---|
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 Summary | |
---|---|
PointND(T... coordinates)
Constructor that initializes the point with a list of coordinates. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
T |
get(int dimension)
Returns the value of a specified dimension. |
int |
getDimensions()
Returns the number of dimensions. |
Point2D |
getPoint2D()
Creates a two-dimensional point from dimensions 0 and 1. |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int X
public static final int Y
public static final int Z
Constructor Detail |
---|
public PointND(T... coordinates)
coordinates
- Coordinate values.Method Detail |
---|
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 Point2D getPoint2D(int dimX, int dimY)
dimX
- Dimension for x coordinate.dimY
- Dimension for y coordinate.
public Point2D getPoint2D()
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |