dmolony-DiskBrowser/src/com/bytezone/diskbrowser/visicalc/Sum.java

27 lines
458 B
Java
Raw Normal View History

2016-03-06 08:05:32 +00:00
package com.bytezone.diskbrowser.visicalc;
public class Sum
{
Range range;
Sheet parent;
public Sum (Sheet parent, String text)
{
this.parent = parent;
range = parent.getRange (text);
}
public double getValue ()
{
double result = 0;
for (Address address : range)
2016-03-06 23:52:46 +00:00
{
Cell cell = parent.getCell (address);
if (cell != null && cell.hasValue ())
result += cell.getValue ();
}
2016-03-06 08:05:32 +00:00
return result;
}
}