Facemorph
Class CSVFile

java.lang.Object
  extended by Facemorph.CSVFile

public class CSVFile
extends java.lang.Object

Load a Comma Separated Value file


Field Summary
protected  java.util.Vector<java.lang.String> columnHeader
           
protected  double[][] data
           
protected  int noColumns
           
protected  int noRecords
           
protected  java.util.Vector<java.lang.String> rowIDs
           
 
Constructor Summary
CSVFile(double[][] inData)
           
CSVFile(double[][] inData, java.util.Vector<java.lang.String> cHeaders, java.util.Vector<java.lang.String> rIDs)
           
CSVFile(java.io.File f, java.lang.String split, boolean idColumn)
           
 
Method Summary
protected  java.util.Vector<java.lang.String> extractHeader(java.lang.String line, java.lang.String split)
           
 double get(int i, int j)
           
 BigMat getAsBigMat()
           
 java.lang.String getColumnHeader(int i)
           
 double[][] getData()
           
 java.util.Vector<java.lang.String> getIDs()
           
 int getNoColumns()
           
 int getNoRecords()
           
 java.lang.String getRecordID(int i)
           
 void read(java.io.File f, java.lang.String split, boolean idColumn)
           
 void set(int i, int j, double val)
           
 void setColumnHeader(int i, java.lang.String header)
           
 void write(java.io.File f, java.lang.String split, boolean idColumn, boolean headers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnHeader

protected java.util.Vector<java.lang.String> columnHeader

rowIDs

protected java.util.Vector<java.lang.String> rowIDs

data

protected double[][] data

noRecords

protected int noRecords

noColumns

protected int noColumns
Constructor Detail

CSVFile

public CSVFile(java.io.File f,
               java.lang.String split,
               boolean idColumn)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(double[][] inData)

CSVFile

public CSVFile(double[][] inData,
               java.util.Vector<java.lang.String> cHeaders,
               java.util.Vector<java.lang.String> rIDs)
Method Detail

getNoRecords

public int getNoRecords()

getNoColumns

public int getNoColumns()

getData

public double[][] getData()

get

public double get(int i,
                  int j)

set

public void set(int i,
                int j,
                double val)

getColumnHeader

public java.lang.String getColumnHeader(int i)

getRecordID

public java.lang.String getRecordID(int i)

getIDs

public java.util.Vector<java.lang.String> getIDs()

setColumnHeader

public void setColumnHeader(int i,
                            java.lang.String header)

read

public void read(java.io.File f,
                 java.lang.String split,
                 boolean idColumn)
          throws java.io.IOException
Throws:
java.io.IOException

getAsBigMat

public BigMat getAsBigMat()

write

public void write(java.io.File f,
                  java.lang.String split,
                  boolean idColumn,
                  boolean headers)
           throws java.io.IOException
Throws:
java.io.IOException

extractHeader

protected java.util.Vector<java.lang.String> extractHeader(java.lang.String line,
                                                           java.lang.String split)