com.rapidminer.example.table
Class ByteArrayDataRow

java.lang.Object
  extended by com.rapidminer.example.table.DataRow
      extended by com.rapidminer.example.table.ByteArrayDataRow
All Implemented Interfaces:
java.io.Serializable

public class ByteArrayDataRow
extends DataRow

Implementation of DataRow that is backed by a byte array. Please note that using this data row is quite efficient but only supports 256 different values (integers between -127 and 128 or 256 different nominal values for each column).

Author:
Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
ByteArrayDataRow(byte[] data)
          Creates a new data row backed by an primitive array.
 
Method Summary
protected  void ensureNumberOfColumns(int numberOfColumns)
          Creates a new array of the given size if necessary and copies the data into the new array.
protected  double get(int index, double defaultValue)
          Returns the value for the desired index.
 int getType()
          This returns the type of this particular DataRow implementation according to the list in the DataRowFactory.
protected  void set(int index, double value, double defaultValue)
          Sets the value for the given index.
 java.lang.String toString()
          Returns a string representation of the data row.
 void trim()
          Does nothing.
 
Methods inherited from class com.rapidminer.example.table.DataRow
get, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayDataRow

public ByteArrayDataRow(byte[] data)
Creates a new data row backed by an primitive array.

Method Detail

get

protected double get(int index,
                     double defaultValue)
Returns the value for the desired index. This method should only be used by attributes.

Specified by:
get in class DataRow

set

protected void set(int index,
                   double value,
                   double defaultValue)
Sets the value for the given index. This method should only be used by attributes.

Specified by:
set in class DataRow

ensureNumberOfColumns

protected void ensureNumberOfColumns(int numberOfColumns)
Creates a new array of the given size if necessary and copies the data into the new array.

Specified by:
ensureNumberOfColumns in class DataRow

trim

public void trim()
Does nothing.

Specified by:
trim in class DataRow

toString

public java.lang.String toString()
Returns a string representation of the data row.

Specified by:
toString in class DataRow

getType

public int getType()
Description copied from class: DataRow
This returns the type of this particular DataRow implementation according to the list in the DataRowFactory.

Specified by:
getType in class DataRow


Copyright © 2001-2009 by Rapid-I