geneticWedge.gp.io
Class StringData

java.lang.Object
  extended by geneticWedge.gp.io.StringData

public class StringData
extends java.lang.Object

This class can extract String data from files and manipulate it in various ways.


Constructor Summary
StringData(java.lang.String[] names, java.lang.String[][] data, java.lang.String[] labels)
          Constructor takes variable names, data and data labels.
 
Method Summary
 java.lang.String[][] getData()
          Returns the data held by this StringData object.
 int getDataLength()
          Returns the number of data items in the dataset.
 int getDimensionality()
          Returns the dimensionality of the data.
 java.lang.String[] getLabels()
          Returns the data labels of the data.
 java.lang.String[] getNames()
          Returns the variable names of the data.
 int[] getNumericIndices()
          This method checks which columns of the data contain numeric data.
 NumericData toNumericData(int[] numericColumns)
          Converts the String data in selected columns into numeric data.
 NumericData toNumericData(int[] numericColumns, java.util.Hashtable<java.lang.String,java.lang.Double> hash)
          Converts the String data in selected columns into numeric data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringData

public StringData(java.lang.String[] names,
                  java.lang.String[][] data,
                  java.lang.String[] labels)
Constructor takes variable names, data and data labels.

Method Detail

getData

public java.lang.String[][] getData()
Returns the data held by this StringData object.


getNames

public java.lang.String[] getNames()
Returns the variable names of the data.


getLabels

public java.lang.String[] getLabels()
Returns the data labels of the data.


toNumericData

public NumericData toNumericData(int[] numericColumns)
                          throws java.lang.NumberFormatException
Converts the String data in selected columns into numeric data. A NumberFormatException will be thrown if any of the selected columns do not contain numeric data.

Throws:
java.lang.NumberFormatException

toNumericData

public NumericData toNumericData(int[] numericColumns,
                                 java.util.Hashtable<java.lang.String,java.lang.Double> hash)
Converts the String data in selected columns into numeric data. The Hashtable contains conversions between String representations and numeric values, so that non-numeric Strings may be converted to numeric values.


getNumericIndices

public int[] getNumericIndices()
This method checks which columns of the data contain numeric data.


getDimensionality

public int getDimensionality()
Returns the dimensionality of the data.


getDataLength

public int getDataLength()
Returns the number of data items in the dataset.