|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCrystalValue
com.crystaldecisions.reports.common.value.FormulaValue
com.crystaldecisions.reports.common.value.NumericValue
com.crystaldecisions.reports.common.value.CurrencyValue
public final class CurrencyValue
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 CurrencyValue |
one
A CurrencyValue object with a value of 1. |
static CurrencyValue |
ten
A CurrencyValue object with a value of 10. |
static CurrencyValue |
two
A CurrencyValue object with a value of 2. |
static CurrencyValue |
zero
A CurrencyValue object with a value of 0. |
Fields inherited from class com.crystaldecisions.reports.common.value.NumericValue |
---|
nExactDecimalPlaces, scalingFactor |
Method Summary | |
---|---|
FormulaValue |
coerceToBoolean()
Internal use only. |
FormulaValue |
coerceToCurrency()
Internal use only. |
FormulaValue |
coerceToNumber()
Returns a FormulaValue object that represents this CurrencyValue as a number. |
static CurrencyValue |
fromDouble(double value)
Returns a CurrencyValue that represents the given double value. |
static CurrencyValue |
fromLong(long value)
Returns a CurrencyValue that represents the given long value. |
static CurrencyValue |
fromNumberValue(NumberValue numberValue)
Returns a CurrencyValue with the same value as the given NumberValue . |
static CurrencyValue |
fromScaledDouble(double scaledDouble)
Returns a CurrencyValue object that represents the value of scaledDouble / scalingFactor . |
static CurrencyValue |
fromScaledLong(long scaledLong)
Returns a CurrencyValue object that represents the value of scaledLong / scalingFactor . |
int |
getEncodedSize(ValueType type)
|
int |
getEncodedSizeForArchive(ValueType type)
|
static int |
GetMaxEncodedSize()
|
ValueType |
getValueType()
Gets the ValueType of this CurrencyValue object. |
static CurrencyValue |
Load(java.io.DataInput in)
|
static CurrencyValue |
LoadFromArchive(IInputArchive ar)
|
void |
store(ValueType type,
ExtendedDataOutput out)
|
void |
storeToArchive(ValueType type,
IOutputArchive ar)
|
java.lang.String |
toString()
Returns a String that represents this CurrencyValue as a String . |
Methods inherited from class com.crystaldecisions.reports.common.value.NumericValue |
---|
compareTo, compareTo, equals, fromDouble, fromLong, fromNumericValue, fromScaledDouble, fromScaledLong, getAsDouble, getAsInteger, getDouble, getInt, getLong, getNormalizedNumericValue, getScaledDouble, getScaledInt, getScaledLong, hashCode, isIntegerValue |
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 |
---|
public static final CurrencyValue zero
A CurrencyValue
object with a value of 0.
public static final CurrencyValue one
A CurrencyValue
object with a value of 1.
public static final CurrencyValue two
A CurrencyValue
object with a value of 2.
public static final CurrencyValue ten
A CurrencyValue
object with a value of 10.
Method Detail |
---|
public void store(ValueType type, ExtendedDataOutput out) throws java.io.IOException
java.io.IOException
public void storeToArchive(ValueType type, IOutputArchive ar) throws ArchiveException
ArchiveException
public static CurrencyValue Load(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static CurrencyValue LoadFromArchive(IInputArchive ar) throws ArchiveException
ArchiveException
public static int GetMaxEncodedSize()
public int getEncodedSizeForArchive(ValueType type)
public int getEncodedSize(ValueType type)
public static CurrencyValue fromScaledDouble(double scaledDouble)
Returns a CurrencyValue
object that represents the value of scaledDouble / scalingFactor
.
scaledDouble
- a double
with a value equal to actualValue * scalingFactor
CurrencyValue
object that represents the value of scaledDouble / scalingFactor
public static CurrencyValue fromScaledLong(long scaledLong)
Returns a CurrencyValue
object that represents the value of scaledLong / scalingFactor
.
scaledLong
- a long
with a value equal to actualValue * scalingFactor
CurrencyValue
object that represents the value of scaledLong / scalingFactor
public static CurrencyValue fromDouble(double value)
Returns a CurrencyValue
that represents the given double
value.
value
- the double
value to be represented
CurrencyValue
object that represents the given double
valuepublic static CurrencyValue fromLong(long value)
Returns a CurrencyValue
that represents the given long
value.
value
- the long
value to be represented
CurrencyValue
object that represents the given long
valuepublic static CurrencyValue fromNumberValue(NumberValue numberValue)
Returns a CurrencyValue
with the same value as the given NumberValue
.
numberValue
- the NumberValue
to represent as a CurrencyValue
CurrencyValue
object that represents the given NumberValue
public FormulaValue coerceToNumber()
Returns a FormulaValue
object that represents this CurrencyValue
as a number.
coerceToNumber
in class FormulaValue
FormulaValue
object that represents this CurrencyValue
as a numberpublic FormulaValue coerceToCurrency()
Internal use only.
coerceToCurrency
in class FormulaValue
public FormulaValue coerceToBoolean()
Internal use only.
coerceToBoolean
in class FormulaValue
public ValueType getValueType()
Gets the ValueType
of this CurrencyValue
object.
public java.lang.String toString()
Returns a String
that represents this CurrencyValue
as a String
. The String
is of the form: "c(42.37)".
toString
in class NumericValue
String
that represents this CurrencyValue
as a String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |