mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-06-27 23:29:37 +00:00
27 lines
464 B
Java
27 lines
464 B
Java
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
public class Sum extends Function
|
|
{
|
|
Range range;
|
|
|
|
public Sum (Sheet parent, String text)
|
|
{
|
|
super (parent, text);
|
|
range = getRange (text);
|
|
}
|
|
|
|
@Override
|
|
public double getValue ()
|
|
{
|
|
double result = 0;
|
|
|
|
for (Address address : range)
|
|
{
|
|
Cell cell = parent.getCell (address);
|
|
if (cell != null && cell.hasValue ())
|
|
result += cell.getValue ();
|
|
}
|
|
|
|
return result;
|
|
}
|
|
} |