|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object databionics.io.BaseFile databionics.io.Array2DFile
public abstract class Array2DFile
Base class for all filetypes with 2D data arrays.
Field Summary | |
---|---|
protected cern.colt.matrix.DoubleMatrix2D |
data
2D matrix. |
protected static org.apache.log4j.Logger |
log
Log4j logging. |
Fields inherited from class databionics.io.BaseFile |
---|
allowEmptyLines, comment, commentPrefix, delimiter, delimiters, file, header, headerPrefix, loc, nf |
Constructor Summary | |
---|---|
Array2DFile()
Standard constructor |
|
Array2DFile(int rows,
int cols)
Constructor with size for an empty array. |
|
Array2DFile(java.lang.String filename)
Constructor with a filename |
Method Summary | |
---|---|
protected void |
buildHeader()
Generate header. |
protected java.lang.String |
buildLine(int row)
Construct a line for saving. |
double |
get(int r,
int c)
Get element of matrix. |
int |
getColumns()
Get number of columns in matrix. |
cern.colt.matrix.DoubleMatrix2D |
getData()
Get 2D matrix. |
int |
getRows()
Get number of rows in matrix. |
int |
getSize()
Get the number of lines in file. |
protected void |
init(int rows,
int cols)
Initialize 2D array. |
protected void |
parseLine(int row,
java.lang.String line)
Parse a line. |
void |
set(int r,
int c,
double v)
Change element of matrix. |
void |
setData(double[][] data)
Set 2D matrix as array |
void |
setData(cern.colt.matrix.DoubleMatrix2D data)
Set 2D matrix. |
Methods inherited from class databionics.io.BaseFile |
---|
checkHeader, checkHeaderAgainstSize, getComment, getFile, getFilename, getHeader, getLocale, getNumberFormat, isHeader, isNaN, isNumber, load, load, parseError, parseHeader, save, save, setComment, setFilename, setLocale, writeStringList, writeStringList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
protected cern.colt.matrix.DoubleMatrix2D data
Constructor Detail |
---|
public Array2DFile()
public Array2DFile(java.lang.String filename)
filename
- Name of the filepublic Array2DFile(int rows, int cols)
rows
- Rows of data array.cols
- Columns of data array.Method Detail |
---|
protected void init(int rows, int cols)
init
in class BaseFile
rows
- Rows of data array.cols
- Columns of data array.protected void parseLine(int row, java.lang.String line)
parseLine
in class BaseFile
row
- Number of current line.line
- Current line.protected void buildHeader()
buildHeader
in class BaseFile
protected java.lang.String buildLine(int row)
buildLine
in class BaseFile
row
- Number of current line.
public int getSize()
getSize
in class BaseFile
public int getColumns()
public int getRows()
public cern.colt.matrix.DoubleMatrix2D getData()
public void setData(cern.colt.matrix.DoubleMatrix2D data)
data
- 2D Data array.public void setData(double[][] data)
data
- 2D Data array.public void set(int r, int c, double v)
r
- Row of value.c
- Column of value.v
- Value.public double get(int r, int c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |