
nz.ac.waikato.modeljunit.storytest.parse.Variable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of paramedit Show documentation
Show all versions of paramedit Show documentation
A tool for editing test parameters and suggesting additional parameter values.
It provides several heuristics (including PairWise and MC/DC) for analyzing
a set of input tuples and suggesting missing/extra values.
The newest version!
/**
*
*/
package nz.ac.waikato.modeljunit.storytest.parse;
import nz.ac.waikato.modeljunit.storytest.CalcTable;
import nz.ac.waikato.modeljunit.storytest.ColumnName;
/**
* @author root
*
*/
public class Variable
implements Function
{
private final ColumnName mColumn;
private final CalcTable mTable;
Variable(String column, CalcTable table)
{
this(table.getColumnName(column), table);
}
Variable(ColumnName column, CalcTable table)
{
mColumn = column;
mTable = table;
}
public double calculate(int row)
{
// System.out.println("DEBUG: mColumn=" + mColumn + "\tnum = " + mTable.getColumnNum(mColumn));
String val = mTable.getValue(row, mTable.getColumnNum(mColumn));
if (val == "") {
return 0;
} else {
return Double.parseDouble(val);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy