Package org.rumbledb.items
Class DecimalItem
java.lang.Object
org.rumbledb.items.AbstractAtomicItem
org.rumbledb.items.DecimalItem
- All Implemented Interfaces:
Serializable,Item
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDecimalItem(BigDecimal decimal) DecimalItem(BigDecimal decimal, String displayValue) -
Method Summary
Modifier and TypeMethodDescriptionCasts the item to a decimal value (must be a numeric).doubleCasts the item to a double value (must be a numeric).floatCasts the item to a float value (must be a numeric).Casts the item to a big integer value (must be a numeric).intCasts the item to an integer value (must be a numeric).copy(boolean mutable) Makes a copy.generateNativeQuery(NativeClauseContext context) Get sparkSql string for the itemReturns the decimal value of the item, if it is a decimal.Returns the dynamic type of the item (only for error message purposes).booleanReturns the effective boolean value of the item, if atomic.Returns the SparkSQL type of the item for use in a query.Returns the SparkSQL value of the item for use in a query.getSparkSQLValue(ItemType itemType) Returns the SparkSQL value of the item for use in a query.Returns the string value of the item, if it is an atomic item.Returns the Object containing the converted value of the item for a DataFrame.booleanisAtomic()Tests whether the item is an atomic item.booleanTests whether the item is an atomic item of type decimal.booleanTests whether the item is a number (decimal or double).Methods inherited from class org.rumbledb.items.AbstractAtomicItem
equals, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rumbledb.api.Item
addOrReplaceNamespace, addParentToDescendants, appendItem, appendSequence, atomizedValue, attributes, baseUri, children, clearSchemaType, declaredNamespaceNodes, documentUri, getBinaryValue, getBodyIterator, getBooleanValue, getCollection, getContent, getDateTimeValue, getDay, getDayTimeDurationComponent, getDFVariablesInClosure, getDoubleValue, getDurationValue, getEpochMillis, getEstimator, getFloatValue, getHour, getIdentifier, getIntegerValue, getIntValue, getItemAt, getItemByKey, getItemByKey, getItemKeys, getItemMembers, getItemValues, getLocalVariablesInClosure, getMinute, getModuleDynamicContext, getMonth, getMutabilityLevel, getNanosecond, getNotationValue, getOffset, getParameterNames, getPathIn, getPeriodValue, getQNameValue, getRDDVariablesInClosure, getSchemaTypeAnnotation, getSecond, getSequenceAt, getSequenceByKey, getSequenceByKey, getSequenceMembers, getSequenceValues, getSignature, getSize, getStringKeys, getTableLocation, getTextValue, getTimeValue, getTopLevelID, getTopLevelOrder, getTransformer, getXmlDocumentPosition, getYear, hasDateTime, hasKey, hasKey, hasTimeZone, isAnyURI, isArray, isArrayOfItems, isAttributeNode, isBase64Binary, isBinary, isBoolean, isBuiltinFunction, isCommentNode, isDate, isDateTime, isDayTimeDuration, isDocumentNode, isDouble, isDuration, isElementNode, isEstimator, isFloat, isFunction, isGDay, isGMonth, isGMonthDay, isGYear, isGYearMonth, isHexBinary, isId, isIdrefs, isInt, isInteger, isMap, isNamespaceNode, isNaN, isNode, isNotation, isNull, isObject, isPeriod, isProcessingInstructionNode, isQName, isString, isTextNode, isTime, isTransformer, isUntypedAtomic, isYearMonthDuration, namespaceNodes, nilled, nodeKind, nodeName, parent, physicalEquals, putItemAt, putItemByKey, putItemByKey, putItemsAt, putLazyItemByKey, putSequenceAt, putSequenceByKey, putSequenceByKey, putSequencesAt, removeItemAt, removeItemByKey, removeItemByKey, removeSequenceAt, serialize, serializeAsJSON, setCollection, setMutabilityLevel, setParent, setPathIn, setSchemaType, setSchemaType, setTableLocation, setTopLevelID, setTopLevelOrder, setXmlDocumentPosition, setXmlSchemaIdentityProperties, setXmlSchemaNilled, typedValue, typeName, unparsedEntityPublicId, unparsedEntitySystemId
-
Constructor Details
-
DecimalItem
-
DecimalItem
-
-
Method Details
-
copy
Description copied from interface:ItemMakes a copy.- Parameters:
mutable- whether the copy should be mutable (if supported by the item).- Returns:
- a copy
-
getDecimalValue
Description copied from interface:ItemReturns the decimal value of the item, if it is a decimal.- Returns:
- the decimal value as a BigDecimal.
-
getVariantValue
Description copied from interface:ItemReturns the Object containing the converted value of the item for a DataFrame. For use to build Variant columns.- Returns:
- Object representing the converted value of the item.
-
getStringValue
Description copied from interface:ItemReturns the string value of the item, if it is an atomic item.- Returns:
- the string value.
-
getEffectiveBooleanValue
public boolean getEffectiveBooleanValue()Description copied from interface:ItemReturns the effective boolean value of the item, if atomic.- Returns:
- the effective boolean value.
-
castToDoubleValue
public double castToDoubleValue()Description copied from interface:ItemCasts the item to a double value (must be a numeric).- Returns:
- the double value.
-
castToFloatValue
public float castToFloatValue()Description copied from interface:ItemCasts the item to a float value (must be a numeric).- Returns:
- the float value.
-
castToDecimalValue
Description copied from interface:ItemCasts the item to a decimal value (must be a numeric).- Returns:
- the BigDecimal value.
-
castToIntValue
public int castToIntValue()Description copied from interface:ItemCasts the item to an integer value (must be a numeric).- Returns:
- the int value.
-
castToIntegerValue
Description copied from interface:ItemCasts the item to a big integer value (must be a numeric).- Returns:
- the BigInteger value.
-
isDecimal
public boolean isDecimal()Description copied from interface:ItemTests whether the item is an atomic item of type decimal.- Returns:
- true if it is an atomic item of type decimal, false otherwise.
-
getDynamicType
Description copied from interface:ItemReturns the dynamic type of the item (only for error message purposes).- Returns:
- the dynamic type as an item type.
-
generateNativeQuery
Description copied from interface:ItemGet sparkSql string for the item- Parameters:
context- input context- Returns:
- String representing the item in a sparksql query or null if it is not supported for the item
-
isNumeric
public boolean isNumeric()Description copied from interface:ItemTests whether the item is a number (decimal or double).- Returns:
- true if it is a number, false otherwise.
-
isAtomic
public boolean isAtomic()Description copied from interface:ItemTests whether the item is an atomic item.- Returns:
- true if it is an atomic item, false otherwise.
-
getSparkSQLValue
Description copied from interface:ItemReturns the SparkSQL value of the item for use in a query.- Returns:
- String representing the SparkSQL value of the item.
-
getSparkSQLValue
Description copied from interface:ItemReturns the SparkSQL value of the item for use in a query.- Returns:
- String representing the SparkSQL value of the item.
-
getSparkSQLType
Description copied from interface:ItemReturns the SparkSQL type of the item for use in a query.- Returns:
- String representing the SparkSQL type of the item.
-