waelti.statistics.queries
Class ResultMatrix
java.lang.Object
waelti.statistics.queries.ResultMatrix
- All Implemented Interfaces:
- java.lang.Iterable<java.lang.Object[]>
public class ResultMatrix
- extends java.lang.Object
- implements java.lang.Iterable<java.lang.Object[]>
A result matrix represents the results of a query. A normal query will compute a two-dimensional
matrix. This class wraps a list so that all data points can be accessed by its coordinates x and
y. Where x is the horizontal and y the vertical dimension. x therefore denotes the position of a
column whereas y denotes the position of a row. The position computed from the upper left corner
starting with (0,0), y denoting the position downwards and x the position to the left.
Constructor Summary |
ResultMatrix(int width)
|
ResultMatrix(java.util.List<java.lang.Object[]> list,
java.util.List<java.lang.String> headings)
|
Method Summary |
void |
addRow()
|
void |
addRow(java.lang.Object[] obj)
|
java.lang.Object |
get(int x,
int y)
|
java.lang.Object[] |
getColumn(int x)
|
java.util.List<java.lang.String> |
getHeadings()
|
java.lang.Object[] |
getRow(int y)
|
java.util.Iterator<java.lang.Object[]> |
iterator()
iterate over the rows. |
void |
set(int x,
int y,
java.lang.Object value)
|
void |
setHeadings(java.util.List<java.lang.String> headings)
|
void |
setRow(int y,
java.lang.Object[] obj)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResultMatrix
public ResultMatrix(int width)
ResultMatrix
public ResultMatrix(java.util.List<java.lang.Object[]> list,
java.util.List<java.lang.String> headings)
set
public void set(int x,
int y,
java.lang.Object value)
get
public java.lang.Object get(int x,
int y)
getRow
public java.lang.Object[] getRow(int y)
setRow
public void setRow(int y,
java.lang.Object[] obj)
getColumn
public java.lang.Object[] getColumn(int x)
addRow
public void addRow()
addRow
public void addRow(java.lang.Object[] obj)
iterator
public java.util.Iterator<java.lang.Object[]> iterator()
- iterate over the rows.
- Specified by:
iterator
in interface java.lang.Iterable<java.lang.Object[]>
getHeadings
public java.util.List<java.lang.String> getHeadings()
setHeadings
public void setHeadings(java.util.List<java.lang.String> headings)
Copyright 2005-2011 by Gerry Weirich, Elexis