mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-06-26 17:29:50 +00:00
display TRUE/FALSE for booleans
This commit is contained in:
parent
3cde604877
commit
914199601e
|
@ -65,6 +65,12 @@ public abstract class AbstractValue implements Value
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoolean ()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// for debugging
|
// for debugging
|
||||||
String getValueText (int depth)
|
String getValueText (int depth)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,4 +39,16 @@ class And extends Function
|
||||||
}
|
}
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoolean ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getText ()
|
||||||
|
{
|
||||||
|
return value == 0 ? "FALSE" : "TRUE";
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -182,6 +182,13 @@ class Cell extends AbstractValue implements Comparable<Cell>
|
||||||
return " " + Format.justify (value.getText (), colWidth - 1, fmtChar);
|
return " " + Format.justify (value.getText (), colWidth - 1, fmtChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value.isBoolean ()) // consider ValueType of BOOLEAN
|
||||||
|
{
|
||||||
|
if (fmtChar != 'L')
|
||||||
|
fmtChar = 'R';
|
||||||
|
return Format.justify (value.getText (), colWidth, fmtChar);
|
||||||
|
}
|
||||||
|
|
||||||
if (colWidth == 1)
|
if (colWidth == 1)
|
||||||
return ".";
|
return ".";
|
||||||
return " " + Format.format (value, fmtChar, colWidth - 1);
|
return " " + Format.format (value, fmtChar, colWidth - 1);
|
||||||
|
|
|
@ -7,5 +7,18 @@ public class False extends Function
|
||||||
super (parent, cell, text);
|
super (parent, cell, text);
|
||||||
|
|
||||||
value = 0;
|
value = 0;
|
||||||
|
valueType = ValueType.VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoolean ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getText ()
|
||||||
|
{
|
||||||
|
return value == 0 ? "FALSE" : "TRUE";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ abstract class Function extends AbstractValue implements Iterable<Value>
|
||||||
static final String[] functionList =
|
static final String[] functionList =
|
||||||
{ "@ABS(", "@ACOS(", "@AND(", "@ASIN(", "@ATAN(", "@AVERAGE(", "@COUNT(",
|
{ "@ABS(", "@ACOS(", "@AND(", "@ASIN(", "@ATAN(", "@AVERAGE(", "@COUNT(",
|
||||||
"@CHOOSE(", "@COS(", "@ERROR", "@EXP(", "@FALSE", "@IF(", "@INT(", "@ISERROR(",
|
"@CHOOSE(", "@COS(", "@ERROR", "@EXP(", "@FALSE", "@IF(", "@INT(", "@ISERROR(",
|
||||||
"@ISNA(", "@LOG10(", "@LOOKUP(", "@LN(", "@MIN(", "@MAX(", "@NA", "@NPV", "@OR(",
|
"@ISNA(", "@LOG10(", "@LOOKUP(", "@LN(", "@MIN(", "@MAX(", "@NA", "@NPV(", "@OR(",
|
||||||
"@PI", "@SIN(", "@SUM(", "@SQRT(", "@TAN(", "@TRUE" };
|
"@PI", "@SIN(", "@SUM(", "@SQRT(", "@TAN(", "@TRUE" };
|
||||||
|
|
||||||
protected final Sheet parent;
|
protected final Sheet parent;
|
||||||
|
|
|
@ -39,4 +39,16 @@ class Or extends Function
|
||||||
}
|
}
|
||||||
value = 0;
|
value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoolean ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getText ()
|
||||||
|
{
|
||||||
|
return value == 0 ? "FALSE" : "TRUE";
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -7,5 +7,18 @@ public class True extends Function
|
||||||
super (parent, cell, text);
|
super (parent, cell, text);
|
||||||
|
|
||||||
value = 1;
|
value = 1;
|
||||||
|
valueType = ValueType.VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoolean ()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getText ()
|
||||||
|
{
|
||||||
|
return value == 0 ? "FALSE" : "TRUE";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,4 +20,6 @@ interface Value
|
||||||
public String getTypeText (); // Number/Function/Expression etc
|
public String getTypeText (); // Number/Function/Expression etc
|
||||||
|
|
||||||
public boolean isVolatile ();
|
public boolean isVolatile ();
|
||||||
|
|
||||||
|
public boolean isBoolean ();
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user