Documentation of 'de.erichseifert.gral.util.PointND' Java class
PointND
de.erichseifert.gral.util

Class PointND<T extends java.lang.Number>

  • Type Parameters:
    T - Data type of the coordinates.
    All Implemented Interfaces:
    java.io.Serializable


    public class PointND<T extends java.lang.Number>
    extends java.lang.Object
    implements java.io.Serializable
    Class for storing n-dimensional points.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      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 Summary

      Constructors 
      Constructor and Description
      PointND(T... coordinates)
      Constructor that initializes the point with a list of coordinates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PointND

        public PointND(T... coordinates)
        Constructor that initializes the point with a list of coordinates.
        Parameters:
        coordinates - Coordinate values.
    • Method Detail

      • getDimensions

        public int getDimensions()
        Returns the number of dimensions.
        Returns:
        Number of dimensions.
      • get

        public T get(int dimension)
        Returns the value of a specified dimension.
        Parameters:
        dimension - Dimension.
        Returns:
        Coordinate value.
      • set

        public void set(int dimension,
                        T coordinate)
        Sets the value of a specified dimension.
        Parameters:
        dimension - Dimension.
        coordinate - New coordinate value.
      • setLocation

        public void setLocation(T... coordinates)
        Sets all coordinate values at once.
        Parameters:
        coordinates - Coordinate values.
      • getPoint2D

        public java.awt.geom.Point2D getPoint2D(int dimX,
                                                int dimY)
        Creates a two-dimensional point from the specified dimensions.
        Parameters:
        dimX - Dimension for x coordinate.
        dimY - Dimension for y coordinate.
        Returns:
        Two-dimensional point.
      • getPoint2D

        public java.awt.geom.Point2D getPoint2D()
        Creates a two-dimensional point from dimensions 0 and 1.
        Returns:
        Two-dimensional point.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.