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 TypeMethodDescriptionvoid
Adds a value pair, if it is an array item.Casts the item to a decimal value (must be a numeric).double
Casts the item to a double value (must be a numeric).float
Casts the item to a float value (must be a numeric).Casts the item to a big integer value (must be a numeric).int
Casts the item to an integer value (must be a numeric).boolean
Tests 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.boolean
Returns 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.double
Returns the double value of the item, if it is a double.Returns the dynamic type of the item (only for error message purposes).boolean
Returns the effective boolean value of the item, if atomic.float
Returns 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.int
Returns 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.int
Returns 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.int
getSize()
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.long
Returns the top level ID of the item.Returns the values of the item, if it is an object.boolean
Tests whether the item contains a representation of date or time (or both).boolean
boolean
isAnyURI()
Tests whether the item is an atomic item of type anyURI.boolean
isArray()
Tests whether the item is an array.boolean
isAtomic()
Tests whether the item is an atomic item.boolean
Tests whether the item is an atomic item of type base64Binary.boolean
isBinary()
Tests whether the item is an atomic item of type base64Binary or hexBinary.boolean
Tests whether the item is an atomic item of type default boolean.boolean
isDate()
Tests whether the item is an atomic item of type date.boolean
Tests whether the item is an atomic item of type dateTime.boolean
Tests whether the item is an atomic item of type dayTimeDuration.boolean
Tests whether the item is an atomic item of type decimal.boolean
isDouble()
Tests whether the item is an atomic item of type double.boolean
Tests whether the item is an atomic item of type duration.boolean
isFloat()
Tests whether the item is an atomic item of type float.boolean
Tests whether the item is a function.boolean
Tests whether the item is an atomic item of type hexBinary.boolean
isInt()
Tests whether the item is an atomic item of type int.boolean
Tests whether the item is an atomic item of type integer.boolean
isNull()
Tests whether the item is the null item.boolean
Tests whether the item is a number (decimal or double).boolean
isObject()
Tests whether the item is an object.boolean
isString()
Tests whether the item is an atomic item of type string.boolean
isTime()
Tests whether the item is an atomic item of type time.boolean
Tests whether the item is an atomic item of type yearMonthDuration.void
Appends an item, if it is an array.void
Add an item at index i, if it is an array.void
putItemByKey
(String key, Item value) Adds a key-value pair, if it is an object item.void
putItemsAt
(List<Item> items, int i) Add all items in items at index i, if it is an array.void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
removeItemAt
(int i) Remove the item at index i, if it is an array.void
removeItemByKey
(String key) Removes a key-value pair, if it is an object item.void
setMutabilityLevel
(int mutabilityLevel) Sets the mutability level of the item to a supplied value.void
Sets the path from the top level object of a DeltaFile for the item to a supplied value.void
setTableLocation
(String location) Sets the location of the DeltaFile for the item to a supplied value.void
setTopLevelID
(long topLevelID) Sets the top level ID of the item to a supplied value.void
write
(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, wait
Methods 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:Item
Tests 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:
write
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
isArray
public boolean isArray()Description copied from interface:Item
Tests whether the item is an array. -
isObject
public boolean isObject()Description copied from interface:Item
Tests whether the item is an object. -
isFunction
public boolean isFunction()Description copied from interface:Item
Tests whether the item is a function.- Specified by:
isFunction
in interfaceItem
- Returns:
- true if it is a function, false otherwise
-
isAtomic
public boolean isAtomic()Description copied from interface:Item
Tests whether the item is an atomic item. -
isString
public boolean isString()Description copied from interface:Item
Tests whether the item is an atomic item of type string. -
isBoolean
public boolean isBoolean()Description copied from interface:Item
Tests whether the item is an atomic item of type default boolean. -
isNull
public boolean isNull()Description copied from interface:Item
Tests whether the item is the null item. -
isNumeric
public boolean isNumeric()Description copied from interface:Item
Tests whether the item is a number (decimal or double). -
isDecimal
public boolean isDecimal()Description copied from interface:Item
Tests whether the item is an atomic item of type decimal. -
isInteger
public boolean isInteger()Description copied from interface:Item
Tests whether the item is an atomic item of type integer. -
isInt
public boolean isInt()Description copied from interface:Item
Tests whether the item is an atomic item of type int. -
isDouble
public boolean isDouble()Description copied from interface:Item
Tests whether the item is an atomic item of type double. -
isFloat
public boolean isFloat()Description copied from interface:Item
Tests whether the item is an atomic item of type float. -
isDuration
public boolean isDuration()Description copied from interface:Item
Tests whether the item is an atomic item of type duration.- Specified by:
isDuration
in interfaceItem
- Returns:
- true if it is an atomic item of type duration, false otherwise.
-
isYearMonthDuration
public boolean isYearMonthDuration()Description copied from interface:Item
Tests whether the item is an atomic item of type yearMonthDuration.- Specified by:
isYearMonthDuration
in interfaceItem
- Returns:
- true if it is an atomic item of type yearMonthDuration, false otherwise.
-
isDayTimeDuration
public boolean isDayTimeDuration()Description copied from interface:Item
Tests whether the item is an atomic item of type dayTimeDuration.- Specified by:
isDayTimeDuration
in interfaceItem
- Returns:
- true if it is an atomic item of type dayTimeDuration, false otherwise.
-
isDateTime
public boolean isDateTime()Description copied from interface:Item
Tests whether the item is an atomic item of type dateTime.- Specified by:
isDateTime
in interfaceItem
- Returns:
- true if it is an atomic item of type dateTime, false otherwise.
-
isDate
public boolean isDate()Description copied from interface:Item
Tests whether the item is an atomic item of type date. -
isTime
public boolean isTime()Description copied from interface:Item
Tests whether the item is an atomic item of type time. -
isAnyURI
public boolean isAnyURI()Description copied from interface:Item
Tests whether the item is an atomic item of type anyURI. -
isBinary
public boolean isBinary()Description copied from interface:Item
Tests whether the item is an atomic item of type base64Binary or hexBinary. -
isHexBinary
public boolean isHexBinary()Description copied from interface:Item
Tests whether the item is an atomic item of type hexBinary.- Specified by:
isHexBinary
in interfaceItem
- Returns:
- true if it is an atomic item of type hexBinary, false otherwise.
-
isBase64Binary
public boolean isBase64Binary()Description copied from interface:Item
Tests whether the item is an atomic item of type base64Binary.- Specified by:
isBase64Binary
in interfaceItem
- Returns:
- true if it is an atomic item of type base64Binary, false otherwise.
-
getItems
Description copied from interface:Item
Returns the members of the item if it is an array. -
getItemAt
Description copied from interface:Item
Returns the member of the item at the specified position if it is an array. -
getKeys
Description copied from interface:Item
Returns the keys of the item, if it is an object. -
getValues
Description copied from interface:Item
Returns the values of the item, if it is an object. -
getItemByKey
Description copied from interface:Item
Returns the value associated with a specific key, if it is an object.- Specified by:
getItemByKey
in interfaceItem
- Parameters:
key
- a key.- Returns:
- the value associated with key.
-
getSize
public int getSize()Description copied from interface:Item
Returns the size of the item, if it is an array. -
getStringValue
Description copied from interface:Item
Returns the string value of the item, if it is an atomic item.- Specified by:
getStringValue
in interfaceItem
- Returns:
- the string value.
-
getBooleanValue
public boolean getBooleanValue()Description copied from interface:Item
Returns the boolean value of the item, if it is a boolean.- Specified by:
getBooleanValue
in interfaceItem
- Returns:
- the boolean value.
-
getDoubleValue
public double getDoubleValue()Description copied from interface:Item
Returns the double value of the item, if it is a double.- Specified by:
getDoubleValue
in interfaceItem
- Returns:
- the double value.
-
getFloatValue
public float getFloatValue()Description copied from interface:Item
Returns the float value of the item, if it is a float.- Specified by:
getFloatValue
in interfaceItem
- Returns:
- the float value.
-
getIntValue
public int getIntValue()Description copied from interface:Item
Returns the int value of the item, if it is an int.- Specified by:
getIntValue
in interfaceItem
- Returns:
- the integer value as an int.
-
getIntegerValue
Description copied from interface:Item
Returns the integer value of the item as a bit integer, if it is an integer.- Specified by:
getIntegerValue
in interfaceItem
- Returns:
- the integer value as a BigInteger.
-
getDecimalValue
Description copied from interface:Item
Returns the decimal value of the item, if it is a decimal.- Specified by:
getDecimalValue
in interfaceItem
- Returns:
- the decimal value as a BigDecimal.
-
getPeriodValue
Description copied from interface:Item
Returns the period value of the item, if it is a duration.- Specified by:
getPeriodValue
in interfaceItem
- Returns:
- the period value as a Period.
-
getDateTimeValue
Description copied from interface:Item
Returns the dateTime value of the item, if it is an atomic item of type dateTimeItem or dateItem or timeItem.- Specified by:
getDateTimeValue
in interfaceItem
- Returns:
- the dateTime value as a OffsetDateTime.
-
getBinaryValue
public byte[] getBinaryValue()Description copied from interface:Item
Returns the byte[] value of the item, if it is an atomic item of type hexBinary or Base64Binary.- Specified by:
getBinaryValue
in interfaceItem
- Returns:
- the binary value as an array of bytes.
-
getDynamicType
Description copied from interface:Item
Returns the dynamic type of the item (only for error message purposes).- Specified by:
getDynamicType
in interfaceItem
- Returns:
- the dynamic type as an item type.
-
getIdentifier
Description copied from interface:Item
Returns the identifier (name and arity) of the function, if it is a function item.- Specified by:
getIdentifier
in interfaceItem
- Returns:
- the function identifier.
-
getParameterNames
Description copied from interface:Item
Returns the names of the parameters of the function, if it is a function item.- Specified by:
getParameterNames
in interfaceItem
- Returns:
- the function parameter names.
-
getSignature
Description copied from interface:Item
Returns the signature of the function, if it is a function item.- Specified by:
getSignature
in interfaceItem
- Returns:
- the function signature.
-
getBodyIterator
Description copied from interface:Item
Returns the body iterator, if it is a function item.- Specified by:
getBodyIterator
in interfaceItem
- Returns:
- the function signature.
-
getLocalVariablesInClosure
Description copied from interface:Item
Returns the local variable bindings, if it is a function item.- Specified by:
getLocalVariablesInClosure
in interfaceItem
- Returns:
- the function signature.
-
getRDDVariablesInClosure
Description copied from interface:Item
Returns the RDD variable bindings, if it is a function item.- Specified by:
getRDDVariablesInClosure
in interfaceItem
- Returns:
- the function signature.
-
getDFVariablesInClosure
Description copied from interface:Item
Returns the DataFrame variable bindings, if it is a function item.- Specified by:
getDFVariablesInClosure
in interfaceItem
- Returns:
- the function signature.
-
getModuleDynamicContext
Description copied from interface:Item
Returns the module dynamic context, if it is a function item.- Specified by:
getModuleDynamicContext
in interfaceItem
- Returns:
- the function signature.
-
hasTimeZone
public boolean hasTimeZone()- Specified by:
hasTimeZone
in interfaceItem
- Returns:
- true if the Item has a timeZone, false otherwise
-
hasDateTime
public boolean hasDateTime()Description copied from interface:Item
Tests whether the item contains a representation of date or time (or both).- Specified by:
hasDateTime
in 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:Item
Returns the effective boolean value of the item, if atomic.- Specified by:
getEffectiveBooleanValue
in interfaceItem
- Returns:
- the effective boolean value.
-
putItem
Description copied from interface:Item
Appends an item, if it is an array. -
append
Description copied from interface:Item
Adds a value pair, if it is an array item. -
putItemByKey
Description copied from interface:Item
Adds a key-value pair, if it is an object item.- Specified by:
putItemByKey
in interfaceItem
- Parameters:
key
- a key.value
- a value.
-
castToDoubleValue
public double castToDoubleValue()Description copied from interface:Item
Casts the item to a double value (must be a numeric).- Specified by:
castToDoubleValue
in interfaceItem
- Returns:
- the double value.
-
castToFloatValue
public float castToFloatValue()Description copied from interface:Item
Casts the item to a float value (must be a numeric).- Specified by:
castToFloatValue
in interfaceItem
- Returns:
- the float value.
-
castToDecimalValue
Description copied from interface:Item
Casts the item to a decimal value (must be a numeric).- Specified by:
castToDecimalValue
in interfaceItem
- Returns:
- the BigDecimal value.
-
castToIntegerValue
Description copied from interface:Item
Casts the item to a big integer value (must be a numeric).- Specified by:
castToIntegerValue
in interfaceItem
- Returns:
- the BigInteger value.
-
castToIntValue
public int castToIntValue()Description copied from interface:Item
Casts the item to an integer value (must be a numeric).- Specified by:
castToIntValue
in interfaceItem
- Returns:
- the int value.
-
generateNativeQuery
Description copied from interface:Item
Get sparkSql string for the item- Specified by:
generateNativeQuery
in 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:Item
Returns the SparkSQL value of the item for use in a query.- Specified by:
getSparkSQLValue
in interfaceItem
- Returns:
- String representing the SparkSQL value of the item.
-
getSparkSQLValue
Description copied from interface:Item
Returns the SparkSQL value of the item for use in a query.- Specified by:
getSparkSQLValue
in interfaceItem
- Returns:
- String representing the SparkSQL value of the item.
-
getSparkSQLType
Description copied from interface:Item
Returns the SparkSQL type of the item for use in a query.- Specified by:
getSparkSQLType
in interfaceItem
- Returns:
- String representing the SparkSQL type of the item.
-
putItemAt
Description copied from interface:Item
Add an item at index i, if it is an array. -
putItemsAt
Description copied from interface:Item
Add all items in items at index i, if it is an array.- Specified by:
putItemsAt
in interfaceItem
- Parameters:
items
- a list of items.i
- an integer.
-
removeItemAt
public void removeItemAt(int i) Description copied from interface:Item
Remove the item at index i, if it is an array.- Specified by:
removeItemAt
in interfaceItem
- Parameters:
i
- an integer.
-
removeItemByKey
Description copied from interface:Item
Removes a key-value pair, if it is an object item.- Specified by:
removeItemByKey
in interfaceItem
- Parameters:
key
- a key.
-
getMutabilityLevel
public int getMutabilityLevel()Description copied from interface:Item
Returns the mutability level of the item.- Specified by:
getMutabilityLevel
in interfaceItem
- Returns:
- an int representing nestedness of the item inside transform expressions.
-
setMutabilityLevel
public void setMutabilityLevel(int mutabilityLevel) Description copied from interface:Item
Sets the mutability level of the item to a supplied value.- Specified by:
setMutabilityLevel
in interfaceItem
- Parameters:
mutabilityLevel
- new mutability level.
-
getTopLevelID
public long getTopLevelID()Description copied from interface:Item
Returns the top level ID of the item.- Specified by:
getTopLevelID
in interfaceItem
- Returns:
- int representing the rowID of the item within a DeltaFile.
-
setTopLevelID
public void setTopLevelID(long topLevelID) Description copied from interface:Item
Sets the top level ID of the item to a supplied value.- Specified by:
setTopLevelID
in interfaceItem
- Parameters:
topLevelID
- new top level ID.
-
getPathIn
Description copied from interface:Item
Returns the path from the top level object of a DeltaFile for the item. -
setPathIn
Description copied from interface:Item
Sets the path from the top level object of a DeltaFile for the item to a supplied value. -
getTableLocation
Description copied from interface:Item
Returns the location of the DeltaFile for the item.- Specified by:
getTableLocation
in interfaceItem
- Returns:
- String representing the location of the DeltaFile for the item.
-
setTableLocation
Description copied from interface:Item
Sets the location of the DeltaFile for the item to a supplied value.- Specified by:
setTableLocation
in interfaceItem
- Parameters:
location
- new location of the DeltaFile for the item.
-