com.hyperion.essbase.calculator
Class CalcBoolean

java.lang.Object
  |
  +--com.hyperion.essbase.calculator.CalcBoolean

public final class CalcBoolean
extends java.lang.Object

Three-value boolean type.
There's only three objects of this type: CalcBoolean.TRUE, CalcBoolean.FALSE, CalcBoolean.MISSING.


Field Summary
static CalcBoolean FALSE
           
static CalcBoolean MISSING
           
static CalcBoolean TRUE
           
 
Method Summary
static CalcBoolean and(CalcBoolean cbx, CalcBoolean cby)
          Logical AND operator in its calc boolean version.
 boolean booleanValue()
          Gets boolean value of calc boolean (missing maps to false)
 double doubleValue()
          Gets double value of calc boolean (can be passed back to Essbase):
 boolean equals(java.lang.Object obj)
          Compares object with another one.
static CalcBoolean getCalcBoolean(boolean b)
          Constructs a calc boolean from a boolean.
static CalcBoolean getCalcBoolean(double x)
          Constructs a calc boolean from a double.
static CalcBoolean getCalcBoolean(java.lang.String s)
          Constructs a calc boolean from a string.
static CalcBoolean not(CalcBoolean cbx)
          Logical NOT operator in its calc boolean version
static CalcBoolean or(CalcBoolean cbx, CalcBoolean cby)
          Logical OR operator in its calc boolean version.
 java.lang.String toString()
          Provides string representation of the object
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FALSE

public static final CalcBoolean FALSE

MISSING

public static final CalcBoolean MISSING

TRUE

public static final CalcBoolean TRUE
Method Detail

and

public static CalcBoolean and(CalcBoolean cbx,
                              CalcBoolean cby)
Logical AND operator in its calc boolean version.
Parameters:
cbx - first term
cby - second term
Returns:
x && y

booleanValue

public boolean booleanValue()
Gets boolean value of calc boolean (missing maps to false)
Returns:
boolean value

doubleValue

public double doubleValue()
Gets double value of calc boolean (can be passed back to Essbase):
Returns:
double representation of the object

equals

public boolean equals(java.lang.Object obj)
Compares object with another one. Note that built-in Java comparison can be used with CalcBoolean objects:
if (a == CalcBoolean.FALSE) ...
Overrides:
equals in class java.lang.Object
Returns:
true if they represent the same value

getCalcBoolean

public static CalcBoolean getCalcBoolean(boolean b)
Constructs a calc boolean from a boolean.
Parameters:
b - boolean to construct a calc boolean from
Returns:
calc boolean

getCalcBoolean

public static CalcBoolean getCalcBoolean(double x)
Constructs a calc boolean from a double. 0.0 converts to CalcBoolean.FALSE, MISSING to CalcBoolean.MISSING, all other values to CalcBoolean.TRUE
Parameters:
x - double to construct a boolean from
Returns:
calc boolean

getCalcBoolean

public static CalcBoolean getCalcBoolean(java.lang.String s)
Constructs a calc boolean from a string. Any value is interpreted as MISSING unless the string is either "true" or "false"
Parameters:
s - string to construct a boolean from
Returns:
calc boolean

not

public static CalcBoolean not(CalcBoolean cbx)
Logical NOT operator in its calc boolean version
Parameters:
x - term
Returns:
!x

or

public static CalcBoolean or(CalcBoolean cbx,
                             CalcBoolean cby)
Logical OR operator in its calc boolean version.
Parameters:
x - first term
y - second term
Returns:
x || y

toString

public java.lang.String toString()
Provides string representation of the object
Overrides:
toString in class java.lang.Object
Returns:
string representation