public abstract class ResultMatrix extends Object implements Serializable, RevisionHandler
toStringMatrix()
toStringKey()
toStringHeader()
toStringSummary()
toStringRanking()
toStringMatrix()
,
toStringKey()
,
toStringHeader()
,
toStringSummary()
,
toStringRanking()
,
Serialized FormModifier and Type | Field and Description |
---|---|
String |
LEFT_PARENTHESES
the left parentheses for enumerating cols/rows
|
String |
LOSS_STRING
loss string
|
protected boolean[] |
m_ColHidden
whether a column is hidden
|
protected String[] |
m_ColNames
the column names
|
protected int |
m_ColNameWidth
the size of the names of the columns
|
protected int[] |
m_ColOrder
the ordering of the columns
|
protected double[] |
m_Counts
the counts for the different datasets
|
protected int |
m_CountWidth
the size of the counts
|
protected boolean |
m_EnumerateColNames
whether a "(x)" is printed before each column name with "x" as the
index
|
protected boolean |
m_EnumerateRowNames
whether a "(x)" is printed before each row name with "x" as the index
|
protected Vector |
m_HeaderKeys
contains the keys for the header
|
protected Vector |
m_HeaderValues
contains the values for the header
|
protected double[][] |
m_Mean
the values
|
protected int |
m_MeanPrec
the standard mean precision
|
protected int |
m_MeanWidth
the size of the mean columns
|
protected int[][] |
m_NonSigWins
the non-significant wins
|
protected boolean |
m_PrintColNames
whether the names or numbers are output as column declarations
|
protected boolean |
m_PrintRowNames
whether the names or numbers are output as row declarations
|
protected int[] |
m_RankingDiff
the difference between wins and losses
|
protected int[] |
m_RankingLosses
the losses in ranking
|
protected int[] |
m_RankingWins
the wins in ranking
|
protected boolean |
m_RemoveFilterName
whether to remove the filter name from the dataaset name
|
protected boolean[] |
m_RowHidden
whether a row is hidden
|
protected String[] |
m_RowNames
the row names
|
protected int |
m_RowNameWidth
the size of the names of the rows
|
protected int[] |
m_RowOrder
the ordering of the rows
|
protected boolean |
m_ShowAverage
whether the average for each column should be printed
|
protected boolean |
m_ShowStdDev
whether std.
|
protected int[][] |
m_Significance
the significance
|
protected int |
m_SignificanceWidth
the size of the significance columns
|
protected double[][] |
m_StdDev
the standard deviation
|
protected int |
m_StdDevPrec
the standard std.
|
protected int |
m_StdDevWidth
the size of the std dev columns
|
protected int[][] |
m_Wins
the significant wins
|
String |
RIGHT_PARENTHESES
the right parentheses for enumerating cols/rows
|
static int |
SIGNIFICANCE_LOSS
loss
|
static int |
SIGNIFICANCE_TIE
tie
|
static int |
SIGNIFICANCE_WIN
win
|
String |
TIE_STRING
tie string
|
String |
WIN_STRING
win string
|
Constructor and Description |
---|
ResultMatrix()
initializes the matrix as 1x1 matrix
|
ResultMatrix(int cols,
int rows)
initializes the matrix with the given dimensions
|
ResultMatrix(ResultMatrix matrix)
initializes the matrix with the values from the given matrix
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String key,
String value)
adds the key-value pair to the header
|
void |
assign(ResultMatrix matrix)
acquires the data from the given matrix
|
void |
clear()
removes the stored data and the ordering, but retains the dimensions of
the matrix
|
void |
clearHeader()
removes all the header information
|
void |
clearRanking()
clears the currently stored ranking data
|
void |
clearSummary()
clears the current summary data
|
protected String |
doubleToString(double d,
int prec)
returns the given number as string rounded to the given number of
decimals.
|
double |
getAverage(int col)
returns the average of the mean at the given position, if the position is
valid, otherwise 0
|
int |
getColCount()
returns the number of columns
|
boolean |
getColHidden(int index)
returns the hidden status of the column, if the index is valid, otherwise
false
|
String |
getColName(int index)
returns the name of the row, if the index is valid, otherwise null.
|
int |
getColNameWidth()
returns the current width for the column names
|
int[] |
getColOrder()
returns the current order of the columns, null means the default order
|
protected int |
getColSize(String[][] data,
int col)
returns the length of the longest cell in the given column
|
protected int |
getColSize(String[][] data,
int col,
boolean skipFirst,
boolean skipLast)
returns the length of the longest cell in the given column
|
double |
getCount(int index)
returns the count for the row.
|
int |
getCountWidth()
returns the current width for the counts
|
int |
getDisplayCol(int index)
returns the displayed index of the given col, depending on the order of
columns, returns -1 if index out of bounds
|
abstract String |
getDisplayName()
returns the name of the output format
|
int |
getDisplayRow(int index)
returns the displayed index of the given row, depending on the order of
rows, returns -1 if index out of bounds
|
boolean |
getEnumerateColNames()
returns whether column names or numbers instead are enumerateed
|
boolean |
getEnumerateRowNames()
returns whether row names or numbers instead are enumerateed
|
String |
getHeader(String key)
returns the value associated with the given key, null if if cannot be
found
|
double |
getMean(int col,
int row)
returns the mean at the given position, if the position is valid,
otherwise 0
|
int |
getMeanPrec()
returns the current precision for the means
|
int |
getMeanWidth()
returns the current width for the mean
|
boolean |
getPrintColNames()
returns whether column names or numbers instead are printed
|
boolean |
getPrintRowNames()
returns whether row names or numbers instead are printed
|
boolean |
getRemoveFilterName()
returns whether the filter classname is removed from the dataset name
|
int |
getRowCount()
returns the number of rows
|
boolean |
getRowHidden(int index)
returns the hidden status of the row, if the index is valid, otherwise
false
|
String |
getRowName(int index)
returns the name of the row, if the index is valid, otherwise null.
|
int |
getRowNameWidth()
returns the current width for the row names
|
int[] |
getRowOrder()
returns the current order of the rows, null means the default order
|
boolean |
getShowAverage()
returns whether average per column is displayed or not
|
boolean |
getShowStdDev()
returns whether std deviations are displayed or not
|
int |
getSignificance(int col,
int row)
returns the significance at the given position, if the position is valid,
otherwise SIGNIFICANCE_ATIE
|
int |
getSignificanceCount(int col,
int type)
counts the occurrences of the given significance type in the given
column.
|
int |
getSignificanceWidth()
returns the current width for the significance
|
double |
getStdDev(int col,
int row)
returns the std deviation at the given position, if the position is valid,
otherwise 0
|
int |
getStdDevPrec()
returns the current standard deviation precision
|
int |
getStdDevWidth()
returns the current width for the std dev
|
protected String |
getSummaryTitle(int col)
returns the character representation of the given column
|
int |
getVisibleColCount()
returns the number of visible columns
|
int |
getVisibleRowCount()
returns the number of visible rows
|
Enumeration |
headerKeys()
returns an enumeration of the header keys
|
protected boolean |
isAverage(int rowIndex)
returns true if the row index (in the array produced by toArray(boolean))
contains the average row
|
protected boolean |
isMean(int index)
returns true if the index (in the array produced by toArray(boolean))
contains a mean
|
protected boolean |
isRowName(int index)
returns true if the index (in the array produced by toArray(boolean))
is the row name
|
protected boolean |
isSignificance(int index)
returns true if the index (in the array produced by toArray(boolean))
contains a significance column
|
protected boolean |
isStdDev(int index)
returns true if the index (in the array produced by toArray(boolean))
contains a std deviation
|
protected String |
padString(String s,
int length)
pads the given string on the right until it reaches the given length, if
longer cuts it down.
|
protected String |
padString(String s,
int length,
boolean left)
pads the given string until it reaches the given length, if longer cuts
it down.
|
protected String |
removeFilterName(String s)
removes the filter classname from the given string if it should be
removed, otherwise leaves the string alone
|
void |
setColHidden(int index,
boolean hidden)
sets the hidden status of the column (if the index is valid)
|
void |
setColName(int index,
String name)
sets the name of the column (if the index is valid)
|
void |
setColNameWidth(int width)
sets the width for the column names (0 = optimal)
|
void |
setColOrder(int[] order)
sets the ordering of the columns, null means default
|
void |
setCount(int index,
double count)
sets the count for the row (if the index is valid)
|
void |
setCountWidth(int width)
sets the width for the counts (0 = optimal)
|
void |
setEnumerateColNames(boolean enumerate)
sets whether the column names are prefixed with "(x)" where "x" is
the index
|
void |
setEnumerateRowNames(boolean enumerate)
sets whether to the row names or numbers instead are enumerateed
|
void |
setMean(int col,
int row,
double value)
sets the mean at the given position (if the position is valid)
|
void |
setMeanPrec(int prec)
sets the precision for the means
|
void |
setMeanWidth(int width)
sets the width for the mean (0 = optimal)
|
void |
setPrintColNames(boolean print)
sets whether the column names or numbers instead are printed.
|
void |
setPrintRowNames(boolean print)
sets whether the row names or numbers instead are printed
deactivating automatically sets m_EnumerateColNames to TRUE.
|
void |
setRanking(int[][] wins)
sets the ranking data based on the wins
|
void |
setRemoveFilterName(boolean remove)
sets whether to remove the filter classname from the dataset name
|
void |
setRowHidden(int index,
boolean hidden)
sets the hidden status of the row (if the index is valid)
|
void |
setRowName(int index,
String name)
sets the name of the row (if the index is valid)
|
void |
setRowNameWidth(int width)
sets the width for the row names (0 = optimal)
|
void |
setRowOrder(int[] order)
sets the ordering of the rows, null means default
|
void |
setShowAverage(boolean show)
sets whether to display the average per column or not
|
void |
setShowStdDev(boolean show)
sets whether to display the std deviations or not
|
void |
setSignificance(int col,
int row,
int value)
sets the significance at the given position (if the position is valid)
|
void |
setSignificanceWidth(int width)
sets the width for the significance (0 = optimal)
|
void |
setSize(int cols,
int rows)
clears the content of the matrix and sets the new size
|
void |
setStdDev(int col,
int row,
double value)
sets the std deviation at the given position (if the position is valid)
|
void |
setStdDevPrec(int prec)
sets the precision for the standard deviation
|
void |
setStdDevWidth(int width)
sets the width for the std dev (0 = optimal)
|
void |
setSummary(int[][] nonSigWins,
int[][] wins)
sets the non-significant and significant wins of the resultsets
|
protected String[][] |
toArray()
returns a 2-dimensional array with the prepared data.
|
String |
toString()
returns the matrix as a string
|
abstract String |
toStringHeader()
returns the header of the matrix as a string
|
abstract String |
toStringKey()
returns returns a key for all the col names, for better readability if
the names got cut off
|
abstract String |
toStringMatrix()
returns the matrix as a string
|
abstract String |
toStringRanking()
returns the ranking in a string representation
|
abstract String |
toStringSummary()
returns the summary as string
|
protected String |
trimString(String s,
int length)
trims the given string down to the given length if longer, otherwise
leaves it unchanged.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRevision
public static final int SIGNIFICANCE_TIE
public static final int SIGNIFICANCE_WIN
public static final int SIGNIFICANCE_LOSS
public String TIE_STRING
public String WIN_STRING
public String LOSS_STRING
public String LEFT_PARENTHESES
public String RIGHT_PARENTHESES
protected String[] m_ColNames
protected String[] m_RowNames
protected boolean[] m_ColHidden
protected boolean[] m_RowHidden
protected int[][] m_Significance
protected double[][] m_Mean
protected double[][] m_StdDev
protected double[] m_Counts
protected int m_MeanPrec
protected int m_StdDevPrec
protected boolean m_ShowStdDev
protected boolean m_ShowAverage
protected boolean m_PrintColNames
protected boolean m_PrintRowNames
protected boolean m_EnumerateColNames
protected boolean m_EnumerateRowNames
protected int m_ColNameWidth
protected int m_RowNameWidth
protected int m_MeanWidth
protected int m_StdDevWidth
protected int m_SignificanceWidth
protected int m_CountWidth
protected Vector m_HeaderKeys
protected Vector m_HeaderValues
protected int[][] m_NonSigWins
protected int[][] m_Wins
protected int[] m_RankingWins
protected int[] m_RankingLosses
protected int[] m_RankingDiff
protected int[] m_RowOrder
protected int[] m_ColOrder
protected boolean m_RemoveFilterName
public ResultMatrix()
public ResultMatrix(int cols, int rows)
public ResultMatrix(ResultMatrix matrix)
matrix
- the matrix to get the values frompublic abstract String getDisplayName()
public void assign(ResultMatrix matrix)
public void clear()
public void setSize(int cols, int rows)
cols
- the number of mean columnsrows
- the number of mean rowspublic void setMeanPrec(int prec)
public int getMeanPrec()
public void setStdDevPrec(int prec)
public int getStdDevPrec()
public void setColNameWidth(int width)
public int getColNameWidth()
public void setRowNameWidth(int width)
public int getRowNameWidth()
public void setMeanWidth(int width)
public int getMeanWidth()
public void setStdDevWidth(int width)
public int getStdDevWidth()
public void setSignificanceWidth(int width)
public int getSignificanceWidth()
public void setCountWidth(int width)
public int getCountWidth()
public void setShowStdDev(boolean show)
public boolean getShowStdDev()
public void setShowAverage(boolean show)
public boolean getShowAverage()
public void setRemoveFilterName(boolean remove)
public boolean getRemoveFilterName()
public void setPrintColNames(boolean print)
setEnumerateColNames(boolean)
public boolean getPrintColNames()
public void setPrintRowNames(boolean print)
setEnumerateRowNames(boolean)
public boolean getPrintRowNames()
public void setEnumerateColNames(boolean enumerate)
public boolean getEnumerateColNames()
public void setEnumerateRowNames(boolean enumerate)
public boolean getEnumerateRowNames()
public int getColCount()
public int getVisibleColCount()
public int getRowCount()
public int getVisibleRowCount()
public void setColName(int index, String name)
index
- the index of the columnname
- the name of the columnpublic String getColName(int index)
public void setRowName(int index, String name)
index
- the index of the rowname
- the name of the rowpublic String getRowName(int index)
public void setColHidden(int index, boolean hidden)
index
- the index of the columnhidden
- the hidden status of the columnpublic boolean getColHidden(int index)
public void setRowHidden(int index, boolean hidden)
index
- the index of the rowhidden
- the hidden status of the rowpublic boolean getRowHidden(int index)
public void setCount(int index, double count)
index
- the index of the rowcount
- the count for the rowpublic double getCount(int index)
index
- the index of the rowpublic void setMean(int col, int row, double value)
col
- the column of the meanrow
- the row of the meanvalue
- the value of the meanpublic double getMean(int col, int row)
public double getAverage(int col)
public void setStdDev(int col, int row, double value)
col
- the column of the std. deviationrow
- the row of the std deviationvalue
- the value of the std deviationpublic double getStdDev(int col, int row)
public void setSignificance(int col, int row, int value)
col
- the column of the significancerow
- the row of the significancevalue
- the value of the significancepublic int getSignificance(int col, int row)
public int getSignificanceCount(int col, int type)
col
- the columnn to gather the information fromtype
- the significance type, WIN/TIE/LOSSpublic void setRowOrder(int[] order)
order
- the new order of the rowspublic int[] getRowOrder()
public int getDisplayRow(int index)
index
- the row to get the displayed index forpublic void setColOrder(int[] order)
order
- the new order of the columnspublic int[] getColOrder()
public int getDisplayCol(int index)
index
- the column to get the displayed index forprotected String doubleToString(double d, int prec)
d
- the number to formatprec
- the number of decimals after the pointprotected String trimString(String s, int length)
s
- the string to trim (if too long)length
- the max. length (0 means infinity)protected String padString(String s, int length)
s
- the string to padlength
- the max. length of the stringprotected String padString(String s, int length, boolean left)
s
- the string to padlength
- the max. length of the stringleft
- whether to pad left or rightprotected int getColSize(String[][] data, int col)
data
- the data to base the calculation oncol
- the column to checkprotected int getColSize(String[][] data, int col, boolean skipFirst, boolean skipLast)
data
- the data to base the calculation oncol
- the column to checkskipFirst
- whether to skip the first rowskipLast
- whether to skip the last rowprotected String removeFilterName(String s)
getRemoveFilterName()
protected String[][] toArray()
protected boolean isRowName(int index)
protected boolean isMean(int index)
protected boolean isAverage(int rowIndex)
protected boolean isStdDev(int index)
protected boolean isSignificance(int index)
public abstract String toStringMatrix()
public String toString()
toString
in class Object
toStringMatrix()
public void clearHeader()
public void addHeader(String key, String value)
key
- the name of the header valuevalue
- the value of the header valuepublic String getHeader(String key)
key
- the key to retrieve the value forpublic Enumeration headerKeys()
public abstract String toStringHeader()
m_HeaderKeys
,
m_HeaderValues
public abstract String toStringKey()
public void clearSummary()
public void setSummary(int[][] nonSigWins, int[][] wins)
nonSigWins
- the non-significant winswins
- the significant winsprotected String getSummaryTitle(int col)
public abstract String toStringSummary()
public void clearRanking()
public void setRanking(int[][] wins)
wins
- the winspublic abstract String toStringRanking()
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.