mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-01 09:50:32 +00:00
41 lines
1.1 KiB
Java
41 lines
1.1 KiB
Java
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
// -----------------------------------------------------------------------------------//
|
|
class And extends ConditionListFunction
|
|
// -----------------------------------------------------------------------------------//
|
|
{
|
|
// ---------------------------------------------------------------------------------//
|
|
And (Cell cell, String text)
|
|
// ---------------------------------------------------------------------------------//
|
|
{
|
|
super (cell, text);
|
|
assert text.startsWith ("@AND(") : text;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
@Override
|
|
public void calculate ()
|
|
// ---------------------------------------------------------------------------------//
|
|
{
|
|
valueResult = ValueResult.VALID;
|
|
|
|
for (Value condition : conditions)
|
|
{
|
|
condition.calculate ();
|
|
|
|
if (condition.getValueType () != ValueType.BOOLEAN)
|
|
{
|
|
valueResult = ValueResult.ERROR;
|
|
return;
|
|
}
|
|
|
|
if (!condition.getBoolean ())
|
|
{
|
|
bool = false;
|
|
return;
|
|
}
|
|
}
|
|
|
|
bool = true;
|
|
}
|
|
} |