Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

mrsoft.util
Class MRData  view MRData download MRData.java

java.lang.Object
  extended bymrsoft.util.MRData
All Implemented Interfaces:
java.lang.Cloneable

public class MRData
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
(package private)  int cols
           
(package private)  double[][] data
           
(package private)  boolean[][] dl
           
(package private)  boolean loaded
           
(package private)  boolean[][] missing
           
(package private)  double missing_val
           
(package private)  java.text.NumberFormat nf
           
(package private)  int rows
           
(package private)  boolean transposed
           
 java.lang.String[] varnames
           
 
Constructor Summary
MRData()
           
 
Method Summary
 void convertDetectionLimits(double weight)
          Finds all values below detection limit (negative values) and converts them to positive values weight times detection limit
 MRData getClone()
           
 double getMissingValue()
          Returns the value that indicates a value is unreported
 double[] getStackArray()
          Returns a single subscripted array with the elements of the data array stacked as [i*cols+j], with i being the row and j the column and cols is the number of columns in the set
 java.lang.String getVarname(int col)
          Returns the (default?) variable name of a column
 boolean isMissing(int row, int col)
          Returns true if the value at row, col is unreported
 boolean isTransposed()
          Returns whther the data is stored in transposed form as array[col][row]
 void lastRecordLoaded(int row)
          Hook into the loading procedure, called when the last record has been loaded.
 void load(java.lang.String file)
          Loads data from a file
 void loadDBF(java.lang.String file)
          Loads data from a file in dbf format version III or IV.
 void loadResultSet(java.sql.ResultSet results)
          Loads the numeric columns in a resultset
 int ncols()
          Returns number of columns
 int nrows()
          Returns number of rows
 void recordLoaded(int row)
          Hook into the loading procedure, called when a new record has been loaded.
 void rescale(int j)
          Rescales column j to the range 0 to 1
 void rescaleAll()
          Rescales all the columns to the range 0 to 1
 boolean save(java.lang.String file)
          Saves the data to a tab-delimited file with the variable names on the first line.
 void setMissingValue(double value)
          Sets the value that indicates a value is unreported
 void transpose()
          swaps rows-columns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loaded

boolean loaded

data

double[][] data

dl

boolean[][] dl

missing

boolean[][] missing

varnames

public java.lang.String[] varnames

transposed

boolean transposed

rows

int rows

cols

int cols

missing_val

double missing_val

nf

java.text.NumberFormat nf
Constructor Detail

MRData

public MRData()
Method Detail

ncols

public int ncols()
Returns number of columns


nrows

public int nrows()
Returns number of rows


getVarname

public java.lang.String getVarname(int col)
Returns the (default?) variable name of a column


setMissingValue

public void setMissingValue(double value)
Sets the value that indicates a value is unreported


getMissingValue

public double getMissingValue()
Returns the value that indicates a value is unreported


isMissing

public boolean isMissing(int row,
                         int col)
Returns true if the value at row, col is unreported


isTransposed

public boolean isTransposed()
Returns whther the data is stored in transposed form as array[col][row]


load

public void load(java.lang.String file)
Loads data from a file


loadDBF

public void loadDBF(java.lang.String file)
Loads data from a file in dbf format version III or IV. Uses package xbase.


loadResultSet

public void loadResultSet(java.sql.ResultSet results)
                   throws java.sql.SQLException
Loads the numeric columns in a resultset


recordLoaded

public void recordLoaded(int row)
Hook into the loading procedure, called when a new record has been loaded. Writes to standard out by default.


lastRecordLoaded

public void lastRecordLoaded(int row)
Hook into the loading procedure, called when the last record has been loaded. Writes to standard out by default.


transpose

public void transpose()
swaps rows-columns


convertDetectionLimits

public void convertDetectionLimits(double weight)
Finds all values below detection limit (negative values) and converts them to positive values weight times detection limit


getClone

public MRData getClone()

getStackArray

public double[] getStackArray()
Returns a single subscripted array with the elements of the data array stacked as [i*cols+j], with i being the row and j the column and cols is the number of columns in the set


save

public boolean save(java.lang.String file)
Saves the data to a tab-delimited file with the variable names on the first line.


rescaleAll

public void rescaleAll()
Rescales all the columns to the range 0 to 1


rescale

public void rescale(int j)
Rescales column j to the range 0 to 1