Package org.rumbledb.items
Class AnnotatedItem
java.lang.Object
org.rumbledb.items.AnnotatedItem
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable,Serializable,Item
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a value pair, if it is an array item.Casts 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).booleanTests for logical equality.generateNativeQuery(NativeClauseContext context) Get sparkSql string for the itembyte[]Returns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.Returns the body iterator, if it is a function item.booleanReturns the boolean value of the item, if it is a boolean.Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.Returns the decimal value of the item, if it is a decimal.Returns the DataFrame variable bindings, if it is a function item.doubleReturns the double value of the item, if it is a double.Returns the dynamic type of the item (only for error message purposes).booleanReturns the effective boolean value of the item, if atomic.floatReturns the float value of the item, if it is a float.Returns the identifier (name and arity) of the function, if it is a function item.Returns the integer value of the item as a bit integer, if it is an integer.intReturns the int value of the item, if it is an int.getItemAt(int position) Returns the member of the item at the specified position if it is an array.getItemByKey(String key) Returns the value associated with a specific key, if it is an object.getItems()Returns the members of the item if it is an array.getKeys()Returns the keys of the item, if it is an object.Returns the local variable bindings, if it is a function item.Returns the module dynamic context, if it is a function item.intReturns the mutability level of the item.Returns the names of the parameters of the function, if it is a function item.Returns the path from the top level object of a DeltaFile for the item.Returns the period value of the item, if it is a duration.Returns the RDD variable bindings, if it is a function item.Returns the signature of the function, if it is a function item.intgetSize()Returns the size of the item, if it is an array.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 location of the DeltaFile for the item.longReturns the top level ID of the item.Returns the values of the item, if it is an object.booleanTests whether the item contains a representation of date or time (or both).booleanbooleanisAnyURI()Tests whether the item is an atomic item of type anyURI.booleanisArray()Tests whether the item is an array.booleanisAtomic()Tests whether the item is an atomic item.booleanTests whether the item is an atomic item of type base64Binary.booleanisBinary()Tests whether the item is an atomic item of type base64Binary or hexBinary.booleanTests whether the item is an atomic item of type default boolean.booleanisDate()Tests whether the item is an atomic item of type date.booleanTests whether the item is an atomic item of type dateTime.booleanTests whether the item is an atomic item of type dayTimeDuration.booleanTests whether the item is an atomic item of type decimal.booleanisDouble()Tests whether the item is an atomic item of type double.booleanTests whether the item is an atomic item of type duration.booleanisFloat()Tests whether the item is an atomic item of type float.booleanTests whether the item is a function.booleanTests whether the item is an atomic item of type hexBinary.booleanisInt()Tests whether the item is an atomic item of type int.booleanTests whether the item is an atomic item of type integer.booleanisNull()Tests whether the item is the null item.booleanTests whether the item is a number (decimal or double).booleanisObject()Tests whether the item is an object.booleanisString()Tests whether the item is an atomic item of type string.booleanisTime()Tests whether the item is an atomic item of type time.booleanTests whether the item is an atomic item of type yearMonthDuration.voidAppends an item, if it is an array.voidAdd an item at index i, if it is an array.voidputItemByKey(String key, Item value) Adds a key-value pair, if it is an object item.voidputItemsAt(List<Item> items, int i) Add all items in items at index i, if it is an array.voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidremoveItemAt(int i) Remove the item at index i, if it is an array.voidremoveItemByKey(String key) Removes a key-value pair, if it is an object item.voidsetMutabilityLevel(int mutabilityLevel) Sets the mutability level of the item to a supplied value.voidSets the path from the top level object of a DeltaFile for the item to a supplied value.voidsetTableLocation(String location) Sets the location of the DeltaFile for the item to a supplied value.voidsetTopLevelID(long topLevelID) Sets the top level ID of the item to a supplied value.voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rumbledb.api.Item
addParentToDescendants, atomizedValue, attributes, children, getContent, getDay, getDurationValue, getEpochMillis, getEstimator, getHour, getMinute, getMonth, getNanosecond, getOffset, getSecond, getTextValue, getTimeValue, getTopLevelOrder, getTransformer, getVariantValue, getXmlDocumentPosition, getYear, hashCode, isAttributeNode, isDocumentNode, isElementNode, isEstimator, isGDay, isGMonth, isGMonthDay, isGYear, isGYearMonth, isNaN, isNode, isPeriod, isTextNode, isTransformer, nodeName, parent, physicalEquals, putLazyItemByKey, serialize, serializeAsJSON, setParent, setTopLevelOrder, setXmlDocumentPosition
-
Constructor Details
-
AnnotatedItem
public AnnotatedItem() -
AnnotatedItem
-
-
Method Details
-
equals
Description copied from interface:ItemTests for logical equality. The semantics are that of the eq operator. -
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
writein interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable
-
isArray
public boolean isArray()Description copied from interface:ItemTests whether the item is an array. -
isObject
public boolean isObject()Description copied from interface:ItemTests whether the item is an object. -
isFunction
public boolean isFunction()Description copied from interface:ItemTests whether the item is a function.- Specified by:
isFunctionin interfaceItem- Returns:
- true if it is a function, false otherwise
-
isAtomic
public boolean isAtomic()Description copied from interface:ItemTests whether the item is an atomic item. -
isString
public boolean isString()Description copied from interface:ItemTests whether the item is an atomic item of type string. -
isBoolean
public boolean isBoolean()Description copied from interface:ItemTests whether the item is an atomic item of type default boolean. -
isNull
public boolean isNull()Description copied from interface:ItemTests whether the item is the null item. -
isNumeric
public boolean isNumeric()Description copied from interface:ItemTests whether the item is a number (decimal or double). -
isDecimal
public boolean isDecimal()Description copied from interface:ItemTests whether the item is an atomic item of type decimal. -
isInteger
public boolean isInteger()Description copied from interface:ItemTests whether the item is an atomic item of type integer. -
isInt
public boolean isInt()Description copied from interface:ItemTests whether the item is an atomic item of type int. -
isDouble
public boolean isDouble()Description copied from interface:ItemTests whether the item is an atomic item of type double. -
isFloat
public boolean isFloat()Description copied from interface:ItemTests whether the item is an atomic item of type float. -
isDuration
public boolean isDuration()Description copied from interface:ItemTests whether the item is an atomic item of type duration.- Specified by:
isDurationin interfaceItem- Returns:
- true if it is an atomic item of type duration, false otherwise.
-
isYearMonthDuration
public boolean isYearMonthDuration()Description copied from interface:ItemTests whether the item is an atomic item of type yearMonthDuration.- Specified by:
isYearMonthDurationin interfaceItem- Returns:
- true if it is an atomic item of type yearMonthDuration, false otherwise.
-
isDayTimeDuration
public boolean isDayTimeDuration()Description copied from interface:ItemTests whether the item is an atomic item of type dayTimeDuration.- Specified by:
isDayTimeDurationin interfaceItem- Returns:
- true if it is an atomic item of type dayTimeDuration, false otherwise.
-
isDateTime
public boolean isDateTime()Description copied from interface:ItemTests whether the item is an atomic item of type dateTime.- Specified by:
isDateTimein interfaceItem- Returns:
- true if it is an atomic item of type dateTime, false otherwise.
-
isDate
public boolean isDate()Description copied from interface:ItemTests whether the item is an atomic item of type date. -
isTime
public boolean isTime()Description copied from interface:ItemTests whether the item is an atomic item of type time. -
isAnyURI
public boolean isAnyURI()Description copied from interface:ItemTests whether the item is an atomic item of type anyURI. -
isBinary
public boolean isBinary()Description copied from interface:ItemTests whether the item is an atomic item of type base64Binary or hexBinary. -
isHexBinary
public boolean isHexBinary()Description copied from interface:ItemTests whether the item is an atomic item of type hexBinary.- Specified by:
isHexBinaryin interfaceItem- Returns:
- true if it is an atomic item of type hexBinary, false otherwise.
-
isBase64Binary
public boolean isBase64Binary()Description copied from interface:ItemTests whether the item is an atomic item of type base64Binary.- Specified by:
isBase64Binaryin interfaceItem- Returns:
- true if it is an atomic item of type base64Binary, false otherwise.
-
getItems
Description copied from interface:ItemReturns the members of the item if it is an array. -
getItemAt
Description copied from interface:ItemReturns the member of the item at the specified position if it is an array. -
getKeys
Description copied from interface:ItemReturns the keys of the item, if it is an object. -
getValues
Description copied from interface:ItemReturns the values of the item, if it is an object. -
getItemByKey
Description copied from interface:ItemReturns the value associated with a specific key, if it is an object.- Specified by:
getItemByKeyin interfaceItem- Parameters:
key- a key.- Returns:
- the value associated with key.
-
getSize
public int getSize()Description copied from interface:ItemReturns the size of the item, if it is an array. -
getStringValue
Description copied from interface:ItemReturns the string value of the item, if it is an atomic item.- Specified by:
getStringValuein interfaceItem- Returns:
- the string value.
-
getBooleanValue
public boolean getBooleanValue()Description copied from interface:ItemReturns the boolean value of the item, if it is a boolean.- Specified by:
getBooleanValuein interfaceItem- Returns:
- the boolean value.
-
getDoubleValue
public double getDoubleValue()Description copied from interface:ItemReturns the double value of the item, if it is a double.- Specified by:
getDoubleValuein interfaceItem- Returns:
- the double value.
-
getFloatValue
public float getFloatValue()Description copied from interface:ItemReturns the float value of the item, if it is a float.- Specified by:
getFloatValuein interfaceItem- Returns:
- the float value.
-
getIntValue
public int getIntValue()Description copied from interface:ItemReturns the int value of the item, if it is an int.- Specified by:
getIntValuein interfaceItem- Returns:
- the integer value as an int.
-
getIntegerValue
Description copied from interface:ItemReturns the integer value of the item as a bit integer, if it is an integer.- Specified by:
getIntegerValuein interfaceItem- Returns:
- the integer value as a BigInteger.
-
getDecimalValue
Description copied from interface:ItemReturns the decimal value of the item, if it is a decimal.- Specified by:
getDecimalValuein interfaceItem- Returns:
- the decimal value as a BigDecimal.
-
getPeriodValue
Description copied from interface:ItemReturns the period value of the item, if it is a duration.- Specified by:
getPeriodValuein interfaceItem- Returns:
- the period value as a Period.
-
getDateTimeValue
Description copied from interface:ItemReturns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.- Specified by:
getDateTimeValuein interfaceItem- Returns:
- the dateTime value as a OffsetDateTime.
-
getBinaryValue
public byte[] getBinaryValue()Description copied from interface:ItemReturns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.- Specified by:
getBinaryValuein interfaceItem- Returns:
- the binary value as an array of bytes.
-
getDynamicType
Description copied from interface:ItemReturns the dynamic type of the item (only for error message purposes).- Specified by:
getDynamicTypein interfaceItem- Returns:
- the dynamic type as an item type.
-
getIdentifier
Description copied from interface:ItemReturns the identifier (name and arity) of the function, if it is a function item.- Specified by:
getIdentifierin interfaceItem- Returns:
- the function identifier.
-
getParameterNames
Description copied from interface:ItemReturns the names of the parameters of the function, if it is a function item.- Specified by:
getParameterNamesin interfaceItem- Returns:
- the function parameter names.
-
getSignature
Description copied from interface:ItemReturns the signature of the function, if it is a function item.- Specified by:
getSignaturein interfaceItem- Returns:
- the function signature.
-
getBodyIterator
Description copied from interface:ItemReturns the body iterator, if it is a function item.- Specified by:
getBodyIteratorin interfaceItem- Returns:
- the function signature.
-
getLocalVariablesInClosure
Description copied from interface:ItemReturns the local variable bindings, if it is a function item.- Specified by:
getLocalVariablesInClosurein interfaceItem- Returns:
- the function signature.
-
getRDDVariablesInClosure
Description copied from interface:ItemReturns the RDD variable bindings, if it is a function item.- Specified by:
getRDDVariablesInClosurein interfaceItem- Returns:
- the function signature.
-
getDFVariablesInClosure
Description copied from interface:ItemReturns the DataFrame variable bindings, if it is a function item.- Specified by:
getDFVariablesInClosurein interfaceItem- Returns:
- the function signature.
-
getModuleDynamicContext
Description copied from interface:ItemReturns the module dynamic context, if it is a function item.- Specified by:
getModuleDynamicContextin interfaceItem- Returns:
- the function signature.
-
hasTimeZone
public boolean hasTimeZone()- Specified by:
hasTimeZonein interfaceItem- Returns:
- true if the Item has a timeZone, false otherwise
-
hasDateTime
public boolean hasDateTime()Description copied from interface:ItemTests whether the item contains a representation of date or time (or both).- Specified by:
hasDateTimein interfaceItem- Returns:
- true if it is an atomic item of type time, date or dateTime, false otherwise.
-
getEffectiveBooleanValue
public boolean getEffectiveBooleanValue()Description copied from interface:ItemReturns the effective boolean value of the item, if atomic.- Specified by:
getEffectiveBooleanValuein interfaceItem- Returns:
- the effective boolean value.
-
putItem
Description copied from interface:ItemAppends an item, if it is an array. -
append
Description copied from interface:ItemAdds a value pair, if it is an array item. -
putItemByKey
Description copied from interface:ItemAdds a key-value pair, if it is an object item.- Specified by:
putItemByKeyin interfaceItem- Parameters:
key- a key.value- a value.
-
castToDoubleValue
public double castToDoubleValue()Description copied from interface:ItemCasts the item to a double value (must be a numeric).- Specified by:
castToDoubleValuein interfaceItem- Returns:
- the double value.
-
castToFloatValue
public float castToFloatValue()Description copied from interface:ItemCasts the item to a float value (must be a numeric).- Specified by:
castToFloatValuein interfaceItem- Returns:
- the float value.
-
castToDecimalValue
Description copied from interface:ItemCasts the item to a decimal value (must be a numeric).- Specified by:
castToDecimalValuein interfaceItem- Returns:
- the BigDecimal value.
-
castToIntegerValue
Description copied from interface:ItemCasts the item to a big integer value (must be a numeric).- Specified by:
castToIntegerValuein interfaceItem- Returns:
- the BigInteger value.
-
castToIntValue
public int castToIntValue()Description copied from interface:ItemCasts the item to an integer value (must be a numeric).- Specified by:
castToIntValuein interfaceItem- Returns:
- the int value.
-
generateNativeQuery
Description copied from interface:ItemGet sparkSql string for the item- Specified by:
generateNativeQueryin interfaceItem- Parameters:
context- input context- Returns:
- String representing the item in a sparksql query or null if it is not supported for the item
-
getSparkSQLValue
Description copied from interface:ItemReturns the SparkSQL value of the item for use in a query.- Specified by:
getSparkSQLValuein interfaceItem- 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.- Specified by:
getSparkSQLValuein interfaceItem- 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.- Specified by:
getSparkSQLTypein interfaceItem- Returns:
- String representing the SparkSQL type of the item.
-
putItemAt
Description copied from interface:ItemAdd an item at index i, if it is an array. -
putItemsAt
Description copied from interface:ItemAdd all items in items at index i, if it is an array.- Specified by:
putItemsAtin interfaceItem- Parameters:
items- a list of items.i- an integer.
-
removeItemAt
public void removeItemAt(int i) Description copied from interface:ItemRemove the item at index i, if it is an array.- Specified by:
removeItemAtin interfaceItem- Parameters:
i- an integer.
-
removeItemByKey
Description copied from interface:ItemRemoves a key-value pair, if it is an object item.- Specified by:
removeItemByKeyin interfaceItem- Parameters:
key- a key.
-
getMutabilityLevel
public int getMutabilityLevel()Description copied from interface:ItemReturns the mutability level of the item.- Specified by:
getMutabilityLevelin interfaceItem- Returns:
- an int representing nestedness of the item inside transform expressions.
-
setMutabilityLevel
public void setMutabilityLevel(int mutabilityLevel) Description copied from interface:ItemSets the mutability level of the item to a supplied value.- Specified by:
setMutabilityLevelin interfaceItem- Parameters:
mutabilityLevel- new mutability level.
-
getTopLevelID
public long getTopLevelID()Description copied from interface:ItemReturns the top level ID of the item.- Specified by:
getTopLevelIDin interfaceItem- Returns:
- int representing the rowID of the item within a DeltaFile.
-
setTopLevelID
public void setTopLevelID(long topLevelID) Description copied from interface:ItemSets the top level ID of the item to a supplied value.- Specified by:
setTopLevelIDin interfaceItem- Parameters:
topLevelID- new top level ID.
-
getPathIn
Description copied from interface:ItemReturns the path from the top level object of a DeltaFile for the item. -
setPathIn
Description copied from interface:ItemSets the path from the top level object of a DeltaFile for the item to a supplied value. -
getTableLocation
Description copied from interface:ItemReturns the location of the DeltaFile for the item.- Specified by:
getTableLocationin interfaceItem- Returns:
- String representing the location of the DeltaFile for the item.
-
setTableLocation
Description copied from interface:ItemSets the location of the DeltaFile for the item to a supplied value.- Specified by:
setTableLocationin interfaceItem- Parameters:
location- new location of the DeltaFile for the item.
-