protected void maybeSavePosted(String what, String where, double mult,
String lpiName, String upiName) {
String method = getParameter(what);
if (method == null) return;
DataRepository data = getDataRepository();
String prefix = getPrefix();
String base = data.createDataName(prefix, where);
String qual = what + method;
String dataName;
SimpleData e, r, lpi, upi;
// Save the chosen method
data.putValue(base+"/Probe Method", StringData.create(method));
// Save the value
e = getNum(qual, Method.FLD_ESTIMATE, mult);
if (e == N_A) {
parameters.put
(NEXT_PAGE, "size".equals(what) ? SIZE_PAGE : TIME_PAGE);
return;
}
data.putValue(base, e);
// Save beta0 and beta1
data.putValue(base+"/Beta0", getNum(qual, Method.FLD_BETA0, mult));
data.putValue(base+"/Beta1", getNum(qual, Method.FLD_BETA1, mult));
// Save the range
data.putValue(base+"/Range", r = getNum(qual, Method.FLD_RANGE, mult));
// Save the interval percent
data.putValue(base+"/Interval Percent",
getNum(qual, Method.FLD_PERCENT, 1));
// Save the correlation
data.putValue(base+"/R Squared",
getNum(qual, Method.FLD_CORRELATION, 1));
if (r instanceof DoubleData) {
double est = ((DoubleData) e).getDouble();
double range = ((DoubleData) r).getDouble();
upi = new DoubleData(est + range);
lpi = new DoubleData(Math.max(0, est - range));
} else
upi = lpi = N_A;
data.putValue(prefix+"/"+lpiName, lpi);
data.putValue(prefix+"/"+upiName, upi);
}