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

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

public class Point<N extends Number>
extends Object
implements Serializable

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

Author:
teras
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 ArrayIndexOutOfBoundsException
Retrieve the value of a specific coordinate of this point

Parameters:
dimension - the coordination dimension
Returns:
the value of this point
Throws:
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


Copyright © 2013. All Rights Reserved.