mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-12 08:08:21 +00:00
44 lines
934 B
Java
44 lines
934 B
Java
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
public class Npv extends RangeFunction
|
|
{
|
|
// private final String valueText;
|
|
// private final String rangeText;
|
|
//
|
|
// private final Expression valueExp;
|
|
|
|
Npv (Sheet parent, String text)
|
|
{
|
|
super (parent, text);
|
|
|
|
// int pos = text.indexOf (',');
|
|
// valueText = text.substring (8, pos);
|
|
// rangeText = text.substring (pos + 1, text.length () - 1);
|
|
//
|
|
// valueExp = new Expression (parent, valueText);
|
|
}
|
|
|
|
@Override
|
|
public Value calculate ()
|
|
{
|
|
value = 0;
|
|
valueType = ValueType.VALUE;
|
|
|
|
for (Address address : range)
|
|
{
|
|
Cell cell = parent.getCell (address);
|
|
if (cell == null || cell.isValueType (ValueType.NA))
|
|
continue;
|
|
|
|
if (cell.isValueType (ValueType.ERROR))
|
|
{
|
|
valueType = ValueType.ERROR;
|
|
break;
|
|
}
|
|
|
|
double temp = cell.getValue ();
|
|
}
|
|
|
|
return this;
|
|
}
|
|
} |