org.knime.base.node.mine.mds
Class DataPoint

java.lang.Object
  extended by org.knime.base.node.mine.mds.DataPoint

public class DataPoint
extends Object

Represents a data point consisting of a values for each dimension. The values of each dimension can be accessed by get and set methods. The dimension of the data point has to be set when creating an instance by calling the constructor and can not be changed afterwards. To create instances of DataPoint see MDSManager.

Author:
Kilian Thiel, University of Konstanz

Constructor Summary
DataPoint(int dimension)
          Creates a new instance of DataPoint with given dimension.
 
Method Summary
 double getElementAt(int index)
          Returns the value of the DataPoint at the given index or dimension respectively.
 void setElementAt(int index, double value)
          Sets the given value at the given index of the data point.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPoint

public DataPoint(int dimension)
          throws IllegalArgumentException
Creates a new instance of DataPoint with given dimension. The dimension can not be changed afterwards.

Parameters:
dimension - The dimension to set. Only positive values greater than zero are allowed here.
Throws:
IllegalArgumentException - If dimension is smaller or equals zero.
Method Detail

getElementAt

public double getElementAt(int index)
                    throws IndexOutOfBoundsException
Returns the value of the DataPoint at the given index or dimension respectively.

Parameters:
index - The index to return the value of the data point at.
Returns:
The value of the data point at the given index.
Throws:
IndexOutOfBoundsException - If the index is less zero or greater than the dimension of the data point.

setElementAt

public void setElementAt(int index,
                         double value)
                  throws IndexOutOfBoundsException
Sets the given value at the given index of the data point.

Parameters:
index - The index to set the value at.
value - The value to set at the specified index.
Throws:
IndexOutOfBoundsException - If the given index is less than zero or greater than the data points dimension.

size

public int size()
Returns:
Returns the size or dimension, respectively of the data point.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.