mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-09-27 09:55:28 +00:00
35 lines
638 B
Java
35 lines
638 B
Java
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
class Min extends ValueListFunction
|
|
{
|
|
public Min (Cell cell, String text)
|
|
{
|
|
super (cell, text);
|
|
|
|
assert text.startsWith ("@MIN(") : text;
|
|
}
|
|
|
|
@Override
|
|
public void calculate ()
|
|
{
|
|
value = Double.MAX_VALUE;
|
|
int totalChecked = 0;
|
|
valueResult = ValueResult.VALID;
|
|
|
|
for (Value v : list)
|
|
{
|
|
v.calculate ();
|
|
if (!v.isValid ())
|
|
{
|
|
valueResult = cell.getValueResult ();
|
|
return;
|
|
}
|
|
|
|
value = Math.min (value, v.getDouble ());
|
|
totalChecked++;
|
|
}
|
|
|
|
if (totalChecked == 0)
|
|
valueResult = ValueResult.NA;
|
|
}
|
|
} |