- All Superinterfaces:
IAnyAtomicItem,IAtomicValuedItem,ICollectionValue,IDecimalItem,IItem,INumericItem
- All Known Subinterfaces:
INonNegativeIntegerItem,IPositiveIntegerItem
An atomic Metapath item containing an integer data value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IIntegerItemThe integer value "-1".static final IIntegerItemThe integer value "1".static final IIntegerItemThe integer value "0". -
Method Summary
Modifier and TypeMethodDescriptiondefault IIntegerItemabs()Get the absolute value of the item.default IIntegerItemadd(IIntegerItem addend) Create a new sum by adding this value to the provided addend value.static IIntegerItemcast(IAnyAtomicItem item) Cast the provided type to this item type.default IIntegerItemcastAsType(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(IIntegerItem item) Compares this value with the argument.default IIntegerItemfloor()Round the value to the whole number closest to negative infinity.default IAtomicOrUnionType<? extends IIntegerItem>getType()Get the type information for the item.default IIntegerItemintegerDivide(IIntegerItem divisor) Divide this dividend value by the provided divisor value using integer division.default IIntegerItemmod(IIntegerItem divisor) Compute the remainder when dividing this dividend value by the provided divisor value.default IIntegerItemmultiply(IIntegerItem multiplier) Multiply this multiplicand value by the provided multiplier value.default IIntegerItemnegate()Reverse the sign of this value.default IIntegerItemsubtract(IIntegerItem subtrahend) Determine the difference by subtracting the provided subtrahend value from this minuend value.default intConvert this integer item to a Java int, precisely.static IAtomicOrUnionType<IIntegerItem>type()Get the type information for this item.static IIntegerItemvalueOf(boolean value) Construct a new integer item using the providedvalue.static IIntegerItemvalueOf(int value) Construct a new integer item using the providedvalue.static IIntegerItemvalueOf(long value) Construct a new integer item using the providedvalue.static IIntegerItemCreate an item from an existing integer value.static IIntegerItemvalueOf(BigInteger value) Construct a new integer 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.atomic.IDecimalItem
add, compareTo, divide, integerDivide, mod, multiply, subtract, toEffectiveBooleanMethods inherited from interface dev.metaschema.core.metapath.item.IItem
contentsAsSequence, flatten, hasValue, toSequence
-
Field Details
-
ONE
The integer value "1". -
ZERO
The integer value "0". -
NEGATIVE_ONE
The integer value "-1".
-
-
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.- Specified by:
getTypein interfaceIDecimalItem- Specified by:
getTypein interfaceIItem- Returns:
- the item's type information
-
valueOf
Create an item from an existing integer value.- Parameters:
value- a string representing an integer value- Returns:
- the item
- Throws:
InvalidTypeMetapathException- if the provided value is not an integer
-
valueOf
Construct a new integer item using the providedvalue.- Parameters:
value- a long value- Returns:
- the new item
-
valueOf
Construct a new integer item using the providedvalue.- Parameters:
value- a long value- Returns:
- the new item
-
valueOf
Construct a new integer item using the providedvalue.- Parameters:
value- a long value- Returns:
- the new item
-
valueOf
Construct a new integer item using the providedvalue.- Parameters:
value- an integer 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 interfaceIDecimalItem- Specified by:
castAsTypein interfaceINumericItem- Parameters:
item- the item to cast- Returns:
- an atomic item of this type
-
abs
Description copied from interface:INumericItemGet the absolute value of the item.- Specified by:
absin interfaceIDecimalItem- 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 interfaceIDecimalItem- 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 interfaceIDecimalItem- Specified by:
floorin interfaceINumericItem- Returns:
- the rounded value
-
toIntValueExact
default int toIntValueExact()Convert this integer item to a Java int, precisely.- Specified by:
toIntValueExactin interfaceIDecimalItem- 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
-
integerDivide
Divide this dividend value by the provided divisor value using integer division.- 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.- 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 interfaceIDecimalItem- 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.
-