com.crystaldecisions.reports.common.value
Class ArrayValue

java.lang.Object
  extended by CrystalValue
      extended by com.crystaldecisions.reports.common.value.FormulaValue
          extended by com.crystaldecisions.reports.common.value.ArrayValue

public final class ArrayValue
extends FormulaValue

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 ArrayValue emptyBooleanArray
           An ArrayValue that represents an empty boolean array.
static ArrayValue emptyCurrencyArray
           An ArrayValue that represents an empty currency array.
static ArrayValue emptyCurrencyRangeArray
           An ArrayValue that represents an empty currency range array.
static ArrayValue emptyDateArray
           An ArrayValue that represents an empty date array.
static ArrayValue emptyDateRangeArray
           An ArrayValue that represents an empty date range array.
static ArrayValue emptyDateTimeArray
           An ArrayValue that represents an empty date-time array.
static ArrayValue emptyDateTimeRangeArray
           An ArrayValue that represents an empty date-time range array.
static ArrayValue emptyNumberArray
           An ArrayValue that represents an empty number array.
static ArrayValue emptyNumberRangeArray
           An ArrayValue that represents an empty number range array.
static ArrayValue emptyStringArray
           An ArrayValue that represents an empty string array.
static ArrayValue emptyStringRangeArray
           An ArrayValue that represents an empty string range array.
static ArrayValue emptyTimeArray
           An ArrayValue that represents an empty time array.
static ArrayValue emptyTimeRangeArray
           An ArrayValue that represents an empty time range array.
 
Method Summary
 FormulaValue coerceToArray()
           Internal use only.
 FormulaValue coerceToBoolean()
           Internal use only.
 FormulaValue coerceToCurrency()
           Internal use only.
 FormulaValue coerceToDate()
           Internal use only.
 FormulaValue coerceToDateTime()
           Internal use only.
 FormulaValue coerceToNumber()
           Internal use only.
 FormulaValue coerceToRange()
           Internal use only.
 FormulaValue coerceToString()
           Internal use only.
 FormulaValue coerceToTime()
           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 an ArrayValue object with the same class and length as this object.
static ArrayValue fromArray(FormulaValue[] formulaValueArray)
           Returns an ArrayValue object that represents an array of FormulaValue objects.
static ArrayValue fromArray(FormulaValue[] formulaValueArray, FormulaValueType elementValueType)
           Internal use only.
static ArrayValue fromList(java.util.List formulaValueList)
           Returns an ArrayValue object that represents a list of FormulaValue objects.
static ArrayValue fromList(java.util.List formulaValueList, FormulaValueType elementValueType)
           Returns an ArrayValue object that represents a list of FormulaValue objects.
static ArrayValue fromMixedRangeArray(FormulaValue[] formulaValueArray)
           Returns an ArrayValue object that represents an array of FormulaValues.
static ArrayValue fromMixedRangeArray(FormulaValue[] formulaValueArray, FormulaValueType elementValueType)
           Returns an ArrayValue object that represents an array of FormulaValues.
static ArrayValue fromMixedRangeList(java.util.List formulaValueList)
           Returns an ArrayValue object that represents a list of FormulaValue objects.
static ArrayValue fromMixedRangeList(java.util.List formulaValueList, FormulaValueType elementValueType)
           Returns an ArrayValue object that represents a list of FormulaValue objects.
static ArrayValue fromSingleValue(FormulaValue formulaValue)
           Returns an ArrayValue object that represents a single FormulaValue.
static ArrayValue fromSingleValue(FormulaValue formulaValue, FormulaValueType elementValueType)
           Returns an ArrayValue object that represents a single FormulaValue.
 FormulaValue get(int index)
           Gets the FormulaValue object at the specified index.
 FormulaValue[] getArray()
           Gets an array of FormulaValue objects from this ArrayValue.
 FormulaValueType getElementFormulaValueType()
           Gets the FormulaValueType of the elements of this ArrayValue.
 int getEncodedSize(ValueType type)
           
 int getEncodedSizeForArchive(ValueType type)
           
 int getLength()
           Gets the number of elements in this ArrayValue.
 java.util.List<FormulaValue> getList()
           Gets a list of FormulaValue objects from this ArrayValue.
 ValueType getValueType()
           Gets the ValueType of this ArrayValue object.
 int hashCode(boolean caseInsensitive)
           Returns a hash code for this ArrayValue object.
static ArrayValue Load(ValueType type, ExtendedDataInput in)
           
static ArrayValue LoadFromArchive(ValueType type, IInputArchive ar)
           
 void store(ValueType type, ExtendedDataOutput out)
           
 void storeToArchive(ValueType type, IOutputArchive ar)
           
 java.lang.String toString()
           Gets a String representation of this ArrayValue.
 
Methods inherited from class com.crystaldecisions.reports.common.value.FormulaValue
coerce, coerceToArray, coerceToBoolean, coerceToCurrency, coerceToDate, coerceToDateTime, coerceToNumber, coerceToRange, coerceToRangeArray, coerceToRangeArray, coerceToString, coerceToTime, getFormulaValueType, makeZeroValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

emptyNumberArray

public static final ArrayValue emptyNumberArray

An ArrayValue that represents an empty number array.


emptyCurrencyArray

public static final ArrayValue emptyCurrencyArray

An ArrayValue that represents an empty currency array.


emptyBooleanArray

public static final ArrayValue emptyBooleanArray

An ArrayValue that represents an empty boolean array.


emptyDateArray

public static final ArrayValue emptyDateArray

An ArrayValue that represents an empty date array.


emptyTimeArray

public static final ArrayValue emptyTimeArray

An ArrayValue that represents an empty time array.


emptyDateTimeArray

public static final ArrayValue emptyDateTimeArray

An ArrayValue that represents an empty date-time array.


emptyStringArray

public static final ArrayValue emptyStringArray

An ArrayValue that represents an empty string array.


emptyNumberRangeArray

public static final ArrayValue emptyNumberRangeArray

An ArrayValue that represents an empty number range array.


emptyCurrencyRangeArray

public static final ArrayValue emptyCurrencyRangeArray

An ArrayValue that represents an empty currency range array.


emptyDateRangeArray

public static final ArrayValue emptyDateRangeArray

An ArrayValue that represents an empty date range array.


emptyTimeRangeArray

public static final ArrayValue emptyTimeRangeArray

An ArrayValue that represents an empty time range array.


emptyDateTimeRangeArray

public static final ArrayValue emptyDateTimeRangeArray

An ArrayValue that represents an empty date-time range array.


emptyStringRangeArray

public static final ArrayValue emptyStringRangeArray

An ArrayValue that represents an empty string range array.

Method Detail

fromArray

public static ArrayValue fromArray(FormulaValue[] formulaValueArray)

Returns an ArrayValue object that represents an array of FormulaValue objects.

Parameters:
formulaValueArray - an array of FormulaValue objects
Returns:
the ArrayValue object that represents the given FormulaValue array
Throws:
java.lang.IllegalArgumentException - if formulaValueArray does not contain all FormulaValues of the same class.

fromArray

public static ArrayValue fromArray(FormulaValue[] formulaValueArray,
                                   FormulaValueType elementValueType)

Internal use only.

Parameters:
formulaValueArray -
elementValueType -
Returns:
array value

fromMixedRangeArray

public static ArrayValue fromMixedRangeArray(FormulaValue[] formulaValueArray)

Returns an ArrayValue object that represents an array of FormulaValues. The input array may contain range values and non-Range Values. Any non-Range values will be coerced into RangeValues when the ArrayValue is constructed.

Parameters:
formulaValueArray - an array of FormulaValues
Returns:
an ArrayValue object containing the specified values or null if the provided array is null.

fromMixedRangeArray

public static ArrayValue fromMixedRangeArray(FormulaValue[] formulaValueArray,
                                             FormulaValueType elementValueType)

Returns an ArrayValue object that represents an array of FormulaValues. The input array may contain range values and non-Range Values. Any non-Range values will be coerced into RangeValues when the ArrayValue is constructed.

Parameters:
formulaValueArray - an array of FormulaValues
elementValueType - the FormulaValueType of each element
Returns:
an ArrayValue object containing the specified values or null if the provided array is null.

fromSingleValue

public static ArrayValue fromSingleValue(FormulaValue formulaValue)

Returns an ArrayValue object that represents a single FormulaValue.

Parameters:
formulaValue - the FormulaValue value
Returns:
an ArrayValue that represents the given FormulaValue

fromSingleValue

public static ArrayValue fromSingleValue(FormulaValue formulaValue,
                                         FormulaValueType elementValueType)

Returns an ArrayValue object that represents a single FormulaValue.

Parameters:
formulaValue - the FormulaValue value
elementValueType - the FormulaValueType of the element
Returns:
an ArrayValue that represents the given FormulaValue

fromList

public static ArrayValue fromList(java.util.List formulaValueList)

Returns an ArrayValue object that represents a list of FormulaValue objects.

Parameters:
formulaValueList - the list of FormulaValue objects
Returns:
an ArrayValue that represents the given list of FormulaValue objects

fromList

public static ArrayValue fromList(java.util.List formulaValueList,
                                  FormulaValueType elementValueType)

Returns an ArrayValue object that represents a list of FormulaValue objects.

Parameters:
formulaValueList - the list of FormulaValue objects
elementValueType - the FormulaValueType of each element
Returns:
an ArrayValue that represents the given list of FormulaValue objects

fromMixedRangeList

public static ArrayValue fromMixedRangeList(java.util.List formulaValueList)

Returns an ArrayValue object that represents a list of FormulaValue objects. The list may contain RangeValues and non-Range Values. Any non-Range values will be coerced into RangeValues when the ArrayValue is constructed.

Parameters:
formulaValueList - the list of FormulaValues to convert
Returns:
an ArrayValue object containing the specified values or null if the provided list is null

fromMixedRangeList

public static ArrayValue fromMixedRangeList(java.util.List formulaValueList,
                                            FormulaValueType elementValueType)

Returns an ArrayValue object that represents a list of FormulaValue objects. The list may contain RangeValues and non-Range Values. Any non-Range values will be coerced into RangeValues when the ArrayValue is constructed.

Parameters:
formulaValueList - the list of FormulaValues to convert
elementValueType - the FormulaValueType of each element
Returns:
an ArrayValue object containing the specified values or null if the provided list is null

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

LoadFromArchive

public static ArrayValue LoadFromArchive(ValueType type,
                                         IInputArchive ar)
                                  throws ArchiveException
Throws:
ArchiveException

Load

public static ArrayValue Load(ValueType type,
                              ExtendedDataInput in)
                       throws java.io.IOException
Throws:
java.io.IOException

getEncodedSizeForArchive

public int getEncodedSizeForArchive(ValueType type)

getEncodedSize

public int getEncodedSize(ValueType type)

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

coerceToDate

public FormulaValue coerceToDate()

Internal use only.

Overrides:
coerceToDate in class FormulaValue

coerceToTime

public FormulaValue coerceToTime()

Internal use only.

Overrides:
coerceToTime in class FormulaValue

coerceToDateTime

public FormulaValue coerceToDateTime()

Internal use only.

Overrides:
coerceToDateTime in class FormulaValue

coerceToString

public FormulaValue coerceToString()

Internal use only.

Overrides:
coerceToString in class FormulaValue

coerceToRange

public FormulaValue coerceToRange()

Internal use only.

Overrides:
coerceToRange in class FormulaValue

coerceToArray

public FormulaValue coerceToArray()

Internal use only.

Overrides:
coerceToArray in class FormulaValue

getArray

public FormulaValue[] getArray()

Gets an array of FormulaValue objects from this ArrayValue.

Returns:
an array of FormulaValue object

getList

public java.util.List<FormulaValue> getList()

Gets a list of FormulaValue objects from this ArrayValue.

Returns:
a List of FormulaValue objects

getLength

public int getLength()

Gets the number of elements in this ArrayValue.

Returns:
the number of elements in this ArrayValue

get

public FormulaValue get(int index)

Gets the FormulaValue object at the specified index.

Parameters:
index - the position from which to retrieve the FormulaValue object
Returns:
the FormulaValue object at the specified index

getValueType

public ValueType getValueType()

Gets the ValueType of this ArrayValue object.

Returns:
the ValueType of this ArrayValue object

getElementFormulaValueType

public FormulaValueType getElementFormulaValueType()

Gets the FormulaValueType of the elements of this ArrayValue.

Returns:
the FormulaValueType of the elements of this ArrayValue

equals

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

Determines whether the parameter Object is an ArrayValue object with the same class and length as this object.

Parameters:
obj - the Object to compare this ArrayValue object to
Returns:
true if obj is an instance of ArrayValue with the same class and length as this object, and if each element of obj is equal to the corresponding element of this object

compareTo

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

Internal use only.


hashCode

public int hashCode(boolean caseInsensitive)

Returns a hash code for this ArrayValue object.

Returns:
the hash code

toString

public java.lang.String toString()

Gets a String representation of this ArrayValue. The string is of the form: "a([s0] [s1] [s2])" where [sN] is the String representation for element N.

Returns:
a String representation of the ArrayValue