com.crystaldecisions.reports.common.value
Class BooleanValue

java.lang.Object
  extended by CrystalValue
      extended by com.crystaldecisions.reports.common.value.FormulaValue
          extended by com.crystaldecisions.reports.common.value.BooleanValue
All Implemented Interfaces:
java.lang.Comparable

public final class BooleanValue
extends FormulaValue
implements java.lang.Comparable

Provides methods for converting native Java types to a format understood by the Crystal Reports Formula Language. All Java user defined functions must return a FormulaValue object.


Field Summary
static BooleanValue FALSE
           A BooleanValue with a value of false.
static BooleanValue TRUE
           A BooleanValue with a value of true.
 
Method Summary
 FormulaValue coerceToBoolean()
           Internal use only.
 FormulaValue coerceToCurrency()
           Internal use only.
 FormulaValue coerceToNumber()
           Internal use only.
 int compareTo(java.lang.Object obj)
           Internal use only.
 int compareTo(java.lang.Object obj, java.util.Comparator stringComparator)
           Internal use only.
 boolean equals(java.lang.Object obj, boolean caseInsensitive)
           Determines whether the parameter Object is a BooleanValue object with the same class and value as this object.
static BooleanValue fromBoolean(boolean booleanValue)
           Returns the BooleanValue form of the given boolean.
static boolean getAsBoolean(CrystalValue value, boolean defaultValue)
           
 boolean getBoolean()
           Returns the boolean form of this BooleanValue object.
 int getEncodedSize(ValueType type)
           
 int getEncodedSizeForArchive(ValueType type)
           
static int GetMaxEncodedSize()
           
 ValueType getValueType()
           Gets the ValueType of this BooleanValue object.
 int hashCode(boolean caseInsensitive)
           Returns a hash code for this BooleanValue object.
static BooleanValue Load(java.io.DataInput in)
           
static BooleanValue LoadFromArchive(IInputArchive ar)
           
 void store(ValueType type, ExtendedDataOutput out)
           
 void storeToArchive(ValueType type, IOutputArchive ar)
           
 java.lang.String toString()
           Returns this BooleanValue as a String.
 
Methods inherited from class com.crystaldecisions.reports.common.value.FormulaValue
coerce, coerceToArray, coerceToArray, coerceToBoolean, coerceToCurrency, coerceToDate, coerceToDate, coerceToDateTime, coerceToDateTime, coerceToNumber, coerceToRange, coerceToRange, coerceToRangeArray, coerceToRangeArray, coerceToString, coerceToString, coerceToTime, coerceToTime, getFormulaValueType, Load, LoadFromArchive, makeZeroValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FALSE

public static final BooleanValue FALSE

A BooleanValue with a value of false.


TRUE

public static final BooleanValue TRUE

A BooleanValue with a value of true.

Method Detail

fromBoolean

public static BooleanValue fromBoolean(boolean booleanValue)

Returns the BooleanValue form of the given boolean.

Parameters:
booleanValue - the boolean to convert
Returns:
a BooleanValue object

getBoolean

public boolean getBoolean()

Returns the boolean form of this BooleanValue object.

Returns:
the boolean form of this BooleanValue object

store

public void store(ValueType type,
                  ExtendedDataOutput out)
           throws java.io.IOException
Throws:
java.io.IOException

storeToArchive

public void storeToArchive(ValueType type,
                           IOutputArchive ar)
                    throws ArchiveException
Throws:
ArchiveException

Load

public static BooleanValue Load(java.io.DataInput in)
                         throws java.io.IOException
Throws:
java.io.IOException

LoadFromArchive

public static BooleanValue LoadFromArchive(IInputArchive ar)
                                    throws ArchiveException
Throws:
ArchiveException

GetMaxEncodedSize

public static int GetMaxEncodedSize()

getEncodedSizeForArchive

public int getEncodedSizeForArchive(ValueType type)

getEncodedSize

public int getEncodedSize(ValueType type)

getValueType

public ValueType getValueType()

Gets the ValueType of this BooleanValue object.

Returns:
ValueType.bool

coerceToNumber

public FormulaValue coerceToNumber()

Internal use only.

Overrides:
coerceToNumber in class FormulaValue

coerceToCurrency

public FormulaValue coerceToCurrency()

Internal use only.

Overrides:
coerceToCurrency in class FormulaValue

coerceToBoolean

public FormulaValue coerceToBoolean()

Internal use only.

Overrides:
coerceToBoolean in class FormulaValue

hashCode

public int hashCode(boolean caseInsensitive)

Returns a hash code for this BooleanValue object.

Returns:
the hash code for this BooleanValue as an int

equals

public boolean equals(java.lang.Object obj,
                      boolean caseInsensitive)

Determines whether the parameter Object is a BooleanValue object with the same class and value as this object.

Parameters:
obj - the Object to compare this BooleanValue object to
Returns:
true if obj is an instance of BooleanValue with the same class and value as this object

compareTo

public int compareTo(java.lang.Object obj,
                     java.util.Comparator stringComparator)

Internal use only.


compareTo

public int compareTo(java.lang.Object obj)

Internal use only.

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()

Returns this BooleanValue as a String.

Returns:
either: "b(true)" or "b(false)"

getAsBoolean

public static boolean getAsBoolean(CrystalValue value,
                                   boolean defaultValue)