- All Superinterfaces:
IAnyAtomicItem,IAtomicValuedItem,ICollectionValue,IItem,INumericItem
- All Known Subinterfaces:
IIntegerItem,INonNegativeIntegerItem,IPositiveIntegerItem
An atomic Metapath item containing a decimal data value.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault INumericItemabs()Get the absolute value of the item.default IDecimalItemadd(IDecimalItem addend) Create a new sum by adding this value to the provided addend value.static IDecimalItemcast(IAnyAtomicItem item) Cast the provided type to this item type.default IDecimalItemcastAsType(IAnyAtomicItem item) Cast the provideditemto be the same type as this item.default IIntegerItemceiling()Round the value to the whole number closest to positive infinity.default intcompareTo(IDecimalItem item) Compares this value with the argument.default IDecimalItemdivide(IDecimalItem divisor) Divide this dividend value by the provided divisor value.default IIntegerItemfloor()Round the value to the whole number closest to negative infinity.default IAtomicOrUnionType<? extends IDecimalItem>getType()Get the type information for the item.default IIntegerItemintegerDivide(INumericItem divisor) Divide this dividend value by the provided divisor value using integer division.default IDecimalItemmod(INumericItem divisor) Compute the remainder when dividing this dividend value by the provided divisor value.default IDecimalItemmultiply(IDecimalItem multiplier) Multiply this multiplicand value by the provided multiplier value.default IDecimalItemnegate()Reverse the sign of this value.default IDecimalItemsubtract(IDecimalItem subtrahend) Determine the difference by subtracting the provided subtrahend value from this minuend value.default booleanGet the effective boolean value of this item based on XPath 3.1.default intConvert this decimal item to a Java int, exactly.static IAtomicOrUnionType<IDecimalItem>type()Get the type information for this item.static IDecimalItemvalueOf(boolean value) Construct a new decimal item using the providedvalue.static IDecimalItemvalueOf(double value) Construct a new decimal item using the providedvalue.static IDecimalItemvalueOf(long value) Construct a new decimal item using the providedvalue.static IDecimalItemConstruct a new decimal item using the provided stringvalue.static IDecimalItemvalueOf(BigDecimal value) Construct a new decimal item using the providedvalue.Methods inherited from interface dev.metaschema.core.metapath.item.atomic.IAnyAtomicItem
accept, asMapKey, asString, asStringItem, atomize, deepEquals, getJavaTypeAdapter, getValue, toAtomicItemMethods inherited from interface dev.metaschema.core.metapath.item.ICollectionValue
deepEquals, toSignatureMethods inherited from interface dev.metaschema.core.metapath.item.IItem
contentsAsSequence, flatten, hasValue, toSequence
-
Field Details
-
ZERO
The decimal item with the value "0".
-
-
Method Details
-
type
Get the type information for this item.- Returns:
- the type information
-
getType
Description copied from interface:IItemGet the type information for the item. -
valueOf
Construct a new decimal item using the provided stringvalue.- Parameters:
value- a string representing a decimal value- Returns:
- the new item
- Throws:
InvalidTypeMetapathException- if the given string is not a decimal value
-
valueOf
Construct a new decimal item using the providedvalue.- Parameters:
value- a long value- Returns:
- the new item
-
valueOf
Construct a new decimal item using the providedvalue.- Parameters:
value- a double value- Returns:
- the new item
-
valueOf
Construct a new decimal item using the providedvalue.- Parameters:
value- a double value- Returns:
- the new item
-
valueOf
Construct a new decimal item using the providedvalue.- Parameters:
value- a decimal value- Returns:
- the new item
-
cast
Cast the provided type to this item type.- Parameters:
item- the item to cast- Returns:
- the original item if it is already this type, otherwise a new item cast to this type
- Throws:
InvalidValueForCastFunctionException- if the provideditemcannot be cast to this type
-
castAsType
Description copied from interface:IAnyAtomicItemCast the provideditemto be the same type as this item.- Specified by:
castAsTypein interfaceIAnyAtomicItem- Specified by:
castAsTypein interfaceINumericItem- Parameters:
item- the item to cast- Returns:
- an atomic item of this type
-
toEffectiveBoolean
default boolean toEffectiveBoolean()Description copied from interface:INumericItemGet the effective boolean value of this item based on XPath 3.1.- Specified by:
toEffectiveBooleanin interfaceINumericItem- Returns:
- the effective boolean value
-
abs
Description copied from interface:INumericItemGet the absolute value of the item.- Specified by:
absin interfaceINumericItem- Returns:
- this item negated if this item is negative, or the item otherwise
-
ceiling
Description copied from interface:INumericItemRound the value to the whole number closest to positive infinity.- Specified by:
ceilingin interfaceINumericItem- Returns:
- the rounded value
-
floor
Description copied from interface:INumericItemRound the value to the whole number closest to negative infinity.- Specified by:
floorin interfaceINumericItem- Returns:
- the rounded value
-
toIntValueExact
default int toIntValueExact()Convert this decimal item to a Java int, exactly. If the decimal is not in a valid int range, an exception is thrown.- Specified by:
toIntValueExactin interfaceINumericItem- Returns:
- the int value
- Throws:
CastFunctionException- if the value does not fit in an int
-
add
Create a new sum by adding this value to the provided addend value.- Parameters:
addend- the second value to sum- Returns:
- a new value resulting from adding this value to the provided addend value
-
subtract
Determine the difference by subtracting the provided subtrahend value from this minuend value.- Parameters:
subtrahend- the value to subtract- Returns:
- a new value resulting from subtracting the subtrahend from the minuend
-
multiply
Multiply this multiplicand value by the provided multiplier value.- Parameters:
multiplier- the value to multiply by- Returns:
- a new value resulting from multiplying the multiplicand by the multiplier
-
divide
Divide this dividend value by the provided divisor value.- Parameters:
divisor- the value to divide by- Returns:
- a new value resulting from dividing the dividend by the divisor
- Throws:
ArithmeticFunctionException- with the codeArithmeticFunctionException.DIVISION_BY_ZEROif the divisor is zero
-
integerDivide
Divide this dividend value by the provided divisor value using integer division.- Specified by:
integerDividein interfaceINumericItem- Parameters:
divisor- the value to divide by- Returns:
- a new value resulting from dividing the dividend by the divisor
-
mod
Compute the remainder when dividing this dividend value by the provided divisor value.- Specified by:
modin interfaceINumericItem- Parameters:
divisor- the value to divide by- Returns:
- a new value containing the remainder resulting from dividing the dividend by the divisor
-
negate
Description copied from interface:INumericItemReverse the sign of this value.- Specified by:
negatein interfaceINumericItem- Returns:
- a new value with the sign reversed
-
compareTo
Compares this value with the argument.- Parameters:
item- the item to compare with this value- Returns:
- a negative integer, zero, or a positive integer if this value is less
than, equal to, or greater than the
item.
-