|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpeakml.math.DataFrame
public abstract class DataFrame
Convenience implementation of an R-like data-frame, which is essentially a matrix
with named rows and columns. It provides specific implementations like
DataFrame.Double and DataFrame.Integer for quick and memory
efficient storage and access to the data. Complete rows or columns can
be retrieved from the matrix for further processing.
When the data-frame is initialized the row- and column-names are initialized to
the index of the the row/column.
Statistical class.
| Nested Class Summary | |
|---|---|
static class |
DataFrame.Double
Implementation of the data-frame with the double data-type. |
| Method Summary | |
|---|---|
int |
getColIndexOf(java.lang.String name)
Returns the index of the column with the given name. |
java.lang.String |
getColName(int col)
Returns the name of the column at the given index. |
java.util.Vector<java.lang.String> |
getColNames()
Returns a list with all the column-names. |
int |
getNrColumns()
Returns the number of columns in the matrix. |
int |
getNrRows()
Returns the number of rows in the matrix. |
int |
getRowIndexOf(java.lang.String name)
Returns the index of the row with the given name. |
java.lang.String |
getRowName(int row)
Returns the name of the row at the given index. |
java.util.Vector<java.lang.String> |
getRowNames()
Returns a list with all the row-names. |
void |
setColName(int col,
java.lang.String name)
Sets the name of the column at the given index. |
void |
setColNames(java.lang.String... names)
Sets all the column-names in one step. |
void |
setColNames(java.util.Vector<java.lang.String> names)
Sets all the column-names in one step. |
void |
setRowName(int row,
java.lang.String name)
Sets the name of the row at the given index. |
void |
setRowNames(java.lang.String... names)
Sets all the row-names in one step. |
void |
setRowNames(java.util.Vector<java.lang.String> names)
Sets all the row-names in one step. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int getNrRows()
public int getRowIndexOf(java.lang.String name)
name - The name of the row.
public java.lang.String getRowName(int row)
throws java.lang.IndexOutOfBoundsException
row - The index of the row.
java.lang.IndexOutOfBoundsException - Thrown when the given index falls outside the range of the number of colomns.public java.util.Vector<java.lang.String> getRowNames()
public void setRowName(int row,
java.lang.String name)
throws java.lang.IndexOutOfBoundsException
row - The row index.name - The new name for the row.
java.lang.IndexOutOfBoundsException - Thrown when the given index falls outside the range of the number of rows.
public void setRowNames(java.util.Vector<java.lang.String> names)
throws java.lang.RuntimeException
names - The list with the row-names.
java.lang.RuntimeException - Thrown when the list with names is not the same size as the number of rows.
public void setRowNames(java.lang.String... names)
throws java.lang.RuntimeException
names - The list with the row-names.
java.lang.RuntimeException - Thrown when the list with names is not the same size as the number of rows.public int getNrColumns()
public int getColIndexOf(java.lang.String name)
name - The name of the column.
public java.lang.String getColName(int col)
throws java.lang.IndexOutOfBoundsException
col - The index of the column.
java.lang.IndexOutOfBoundsException - Thrown when the given index falls outside the range of the number of columns.public java.util.Vector<java.lang.String> getColNames()
public void setColName(int col,
java.lang.String name)
col - The column index.name - The new name for the column.
java.lang.IndexOutOfBoundsException - Thrown when the given index falls outside the range of the number of columns.
public void setColNames(java.util.Vector<java.lang.String> names)
throws java.lang.RuntimeException
names - The list with the column-names.
java.lang.RuntimeException - Thrown when the list with names is not the same size as the number of column.
public void setColNames(java.lang.String... names)
throws java.lang.RuntimeException
names - The list with the column-names.
java.lang.RuntimeException - Thrown when the list with names is not the same size as the number of column.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||