2016-03-15 04:40:57 +00:00
|
|
|
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
|
|
|
|
public class Abs extends Function
|
|
|
|
{
|
2017-03-03 23:41:08 +00:00
|
|
|
private final Expression source;
|
2017-02-25 03:56:22 +00:00
|
|
|
|
2017-03-18 08:33:40 +00:00
|
|
|
Abs (Cell cell, String text)
|
2016-03-15 04:40:57 +00:00
|
|
|
{
|
2017-03-18 08:33:40 +00:00
|
|
|
super (cell, text);
|
2017-03-03 23:41:08 +00:00
|
|
|
|
2017-03-18 09:21:11 +00:00
|
|
|
assert text.startsWith ("@ABS(") : text;
|
|
|
|
|
2017-03-14 11:28:52 +00:00
|
|
|
source = new Expression (parent, cell, functionText);
|
2017-03-03 23:41:08 +00:00
|
|
|
values.add (source);
|
2016-03-15 04:40:57 +00:00
|
|
|
}
|
|
|
|
|
2016-03-15 20:06:04 +00:00
|
|
|
@Override
|
2017-02-28 20:39:26 +00:00
|
|
|
public void calculate ()
|
2016-03-15 04:40:57 +00:00
|
|
|
{
|
2017-03-03 23:41:08 +00:00
|
|
|
source.calculate ();
|
2017-02-25 03:56:22 +00:00
|
|
|
|
|
|
|
value = Math.abs (source.getValue ());
|
|
|
|
valueType = source.getValueType ();
|
2016-03-15 04:40:57 +00:00
|
|
|
}
|
|
|
|
}
|