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

31 lines
987 B
Java
Raw Normal View History

2017-03-25 21:58:10 +00:00
package com.bytezone.diskbrowser.visicalc;
2020-02-10 11:05:40 +00:00
// -----------------------------------------------------------------------------------//
class Not extends BooleanFunction
// -----------------------------------------------------------------------------------//
2017-03-25 21:58:10 +00:00
{
2020-02-10 11:05:40 +00:00
// ---------------------------------------------------------------------------------//
2017-03-25 21:58:10 +00:00
Not (Cell cell, String text)
2020-02-10 11:05:40 +00:00
// ---------------------------------------------------------------------------------//
2017-03-25 21:58:10 +00:00
{
super (cell, text);
assert text.startsWith ("@NOT(") : text;
}
2020-02-10 11:05:40 +00:00
// ---------------------------------------------------------------------------------//
2017-03-25 21:58:10 +00:00
@Override
public void calculate ()
2020-02-10 11:05:40 +00:00
// ---------------------------------------------------------------------------------//
2017-03-25 21:58:10 +00:00
{
source.calculate ();
if (source.getValueType () != ValueType.BOOLEAN)
{
valueResult = ValueResult.ERROR;
return;
}
bool = !source.getBoolean ();
valueResult = ValueResult.VALID;
}
}