com.rapidminer.example.table
Class DataRow

java.lang.Object
  extended by com.rapidminer.example.table.DataRow
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbstractSparseArrayDataRow, BooleanArrayDataRow, ByteArrayDataRow, DatabaseDataRow, DoubleArrayDataRow, FloatArrayDataRow, IntArrayDataRow, LongArrayDataRow, NonWritableDataRow, ShortArrayDataRow, SparseMapDataRow

public abstract class DataRow
extends java.lang.Object
implements java.io.Serializable

This interface defines methods for all entries of ExampleTable implementations. It provides a set and get method for the data. Subclasses may use a double array, a sparse representation, a file or a database.

Author:
Simon Fischer, Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
DataRow()
           
 
Method Summary
protected abstract  void ensureNumberOfColumns(int numberOfColumns)
          Ensures that neither get(i) nor put(i,v) throw a runtime exception for all 0 <= i <= numberOfColumns.
 double get(Attribute attribute)
          Returns the value stored at the given Attribute's index.
protected abstract  double get(int index, double defaultValue)
          Returns the value for the given index.
 void set(Attribute attribute, double value)
          Sets the value of the Attribute to value.
protected abstract  void set(int index, double value, double defaultValue)
          Sets the given data for the given index.
abstract  java.lang.String toString()
          Returns a string representation for this data row.
abstract  void trim()
          Trims the number of columns to the actually needed number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataRow

public DataRow()
Method Detail

get

protected abstract double get(int index,
                              double defaultValue)
Returns the value for the given index.


set

protected abstract void set(int index,
                            double value,
                            double defaultValue)
Sets the given data for the given index.


ensureNumberOfColumns

protected abstract void ensureNumberOfColumns(int numberOfColumns)
Ensures that neither get(i) nor put(i,v) throw a runtime exception for all 0 <= i <= numberOfColumns.


trim

public abstract void trim()
Trims the number of columns to the actually needed number.


toString

public abstract java.lang.String toString()
Returns a string representation for this data row.

Overrides:
toString in class java.lang.Object

get

public double get(Attribute attribute)
Returns the value stored at the given Attribute's index. Returns Double.NaN if the given attribute is null.


set

public void set(Attribute attribute,
                double value)
Sets the value of the Attribute to value.



Copyright © 2001-2009 by Rapid-I