com.panayotis.gnuplot.dataset
Class Point<N extends java.lang.Number>

java.lang.Object
  extended by com.panayotis.gnuplot.dataset.Point<N>
All Implemented Interfaces:
java.io.Serializable

public class Point<N extends java.lang.Number>
extends java.lang.Object
implements java.io.Serializable

This object represents a N-dimensional point. It is used in PointDataSet as the actual data object

See Also:
Serialized Form

Constructor Summary
Point(N... coords)
          Creates a new instance of Point with given coocrdinates
 
Method Summary
 N get(int dimension)
          Retrieve the value of a specific coordinate of this point
 int getDimensions()
          Retrieve the actual coordinations of this point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Point

public Point(N... coords)
Creates a new instance of Point with given coocrdinates

Parameters:
coords - The coordinates given as a list of native (or boxed) type numbers.
Method Detail

get

public N get(int dimension)
                               throws java.lang.ArrayIndexOutOfBoundsException
Retrieve the value of a specific coordinate of this point

Parameters:
dimension - the coordination dimension
Returns:
the value of this point
Throws:
java.lang.ArrayIndexOutOfBoundsException - The coordination required is not present

getDimensions

public int getDimensions()
Retrieve the actual coordinations of this point

Returns:
The coordinations (dimensions) of this point