Class AnnotatedItem

java.lang.Object
org.rumbledb.items.AnnotatedItem
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable, Item

public class AnnotatedItem extends Object implements Item
See Also:
  • Constructor Details

    • AnnotatedItem

      public AnnotatedItem()
    • AnnotatedItem

      public AnnotatedItem(Item itemToAnnotate, ItemType type)
  • Method Details

    • equals

      public boolean equals(Object otherItem)
      Description copied from interface: Item
      Tests for logical equality. The semantics are that of the eq operator.
      Specified by:
      equals in interface Item
      Overrides:
      equals in class Object
      Parameters:
      otherItem - another item.
      Returns:
      true it is equal to other, false otherwise.
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
    • isArray

      public boolean isArray()
      Description copied from interface: Item
      Tests whether the item is an array.
      Specified by:
      isArray in interface Item
      Returns:
      true if it is an array, false otherwise.
    • isObject

      public boolean isObject()
      Description copied from interface: Item
      Tests whether the item is an object.
      Specified by:
      isObject in interface Item
      Returns:
      true if it is an object, false otherwise.
    • isFunction

      public boolean isFunction()
      Description copied from interface: Item
      Tests whether the item is a function.
      Specified by:
      isFunction in interface Item
      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.
      Specified by:
      isAtomic in interface Item
      Returns:
      true if it is an atomic item, false otherwise.
    • isString

      public boolean isString()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type string.
      Specified by:
      isString in interface Item
      Returns:
      true if it is an atomic item of type string, false otherwise.
    • isBoolean

      public boolean isBoolean()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type default boolean.
      Specified by:
      isBoolean in interface Item
      Returns:
      true if it is an atomic item of type default boolean, false otherwise.
    • isNull

      public boolean isNull()
      Description copied from interface: Item
      Tests whether the item is the null item.
      Specified by:
      isNull in interface Item
      Returns:
      true if it is the null item, false otherwise.
    • isNumeric

      public boolean isNumeric()
      Description copied from interface: Item
      Tests whether the item is a number (decimal or double).
      Specified by:
      isNumeric in interface Item
      Returns:
      true if it is a number, false otherwise.
    • isDecimal

      public boolean isDecimal()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type decimal.
      Specified by:
      isDecimal in interface Item
      Returns:
      true if it is an atomic item of type decimal, false otherwise.
    • isInteger

      public boolean isInteger()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type integer.
      Specified by:
      isInteger in interface Item
      Returns:
      true if it is an atomic item of type integer, false otherwise.
    • isInt

      public boolean isInt()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type int.
      Specified by:
      isInt in interface Item
      Returns:
      true if it is an atomic item of type int, false otherwise.
    • isDouble

      public boolean isDouble()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type double.
      Specified by:
      isDouble in interface Item
      Returns:
      true if it is an atomic item of type double, false otherwise.
    • isFloat

      public boolean isFloat()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type float.
      Specified by:
      isFloat in interface Item
      Returns:
      true if it is an atomic item of type float, false otherwise.
    • isDuration

      public boolean isDuration()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type duration.
      Specified by:
      isDuration in interface Item
      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 interface Item
      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 interface Item
      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 interface Item
      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.
      Specified by:
      isDate in interface Item
      Returns:
      true if it is an atomic item of type date, false otherwise.
    • isTime

      public boolean isTime()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type time.
      Specified by:
      isTime in interface Item
      Returns:
      true if it is an atomic item of type time, false otherwise.
    • isAnyURI

      public boolean isAnyURI()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type anyURI.
      Specified by:
      isAnyURI in interface Item
      Returns:
      true if it is an atomic item of type anyURI, false otherwise.
    • isBinary

      public boolean isBinary()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type base64Binary or hexBinary.
      Specified by:
      isBinary in interface Item
      Returns:
      true if it is an atomic item of type base64Binary or hexBinary, false otherwise.
    • isHexBinary

      public boolean isHexBinary()
      Description copied from interface: Item
      Tests whether the item is an atomic item of type hexBinary.
      Specified by:
      isHexBinary in interface Item
      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 interface Item
      Returns:
      true if it is an atomic item of type base64Binary, false otherwise.
    • getItems

      public List<Item> getItems()
      Description copied from interface: Item
      Returns the members of the item if it is an array.
      Specified by:
      getItems in interface Item
      Returns:
      the list of the array members.
    • getItemAt

      public Item getItemAt(int position)
      Description copied from interface: Item
      Returns the member of the item at the specified position if it is an array.
      Specified by:
      getItemAt in interface Item
      Parameters:
      position - a position.
      Returns:
      the member at position position.
    • getKeys

      public List<String> getKeys()
      Description copied from interface: Item
      Returns the keys of the item, if it is an object.
      Specified by:
      getKeys in interface Item
      Returns:
      the list of the keys.
    • getValues

      public List<Item> getValues()
      Description copied from interface: Item
      Returns the values of the item, if it is an object.
      Specified by:
      getValues in interface Item
      Returns:
      the list of the value items.
    • getItemByKey

      public Item getItemByKey(String key)
      Description copied from interface: Item
      Returns the value associated with a specific key, if it is an object.
      Specified by:
      getItemByKey in interface Item
      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.
      Specified by:
      getSize in interface Item
      Returns:
      the size as an int.
    • getStringValue

      public String getStringValue()
      Description copied from interface: Item
      Returns the string value of the item, if it is an atomic item.
      Specified by:
      getStringValue in interface Item
      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 interface Item
      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 interface Item
      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 interface Item
      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 interface Item
      Returns:
      the integer value as an int.
    • getIntegerValue

      public BigInteger 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 interface Item
      Returns:
      the integer value as a BigInteger.
    • getDecimalValue

      public BigDecimal getDecimalValue()
      Description copied from interface: Item
      Returns the decimal value of the item, if it is a decimal.
      Specified by:
      getDecimalValue in interface Item
      Returns:
      the decimal value as a BigDecimal.
    • getPeriodValue

      public Period getPeriodValue()
      Description copied from interface: Item
      Returns the period value of the item, if it is a duration.
      Specified by:
      getPeriodValue in interface Item
      Returns:
      the period value as a Period.
    • getDateTimeValue

      public OffsetDateTime 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 interface Item
      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 interface Item
      Returns:
      the binary value as an array of bytes.
    • getDynamicType

      public ItemType getDynamicType()
      Description copied from interface: Item
      Returns the dynamic type of the item (only for error message purposes).
      Specified by:
      getDynamicType in interface Item
      Returns:
      the dynamic type as an item type.
    • getIdentifier

      public FunctionIdentifier 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 interface Item
      Returns:
      the function identifier.
    • getParameterNames

      public List<Name> 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 interface Item
      Returns:
      the function parameter names.
    • getSignature

      public FunctionSignature getSignature()
      Description copied from interface: Item
      Returns the signature of the function, if it is a function item.
      Specified by:
      getSignature in interface Item
      Returns:
      the function signature.
    • getBodyIterator

      public RuntimeIterator getBodyIterator()
      Description copied from interface: Item
      Returns the body iterator, if it is a function item.
      Specified by:
      getBodyIterator in interface Item
      Returns:
      the function signature.
    • getLocalVariablesInClosure

      public Map<Name,List<Item>> getLocalVariablesInClosure()
      Description copied from interface: Item
      Returns the local variable bindings, if it is a function item.
      Specified by:
      getLocalVariablesInClosure in interface Item
      Returns:
      the function signature.
    • getRDDVariablesInClosure

      public Map<Name,org.apache.spark.api.java.JavaRDD<Item>> getRDDVariablesInClosure()
      Description copied from interface: Item
      Returns the RDD variable bindings, if it is a function item.
      Specified by:
      getRDDVariablesInClosure in interface Item
      Returns:
      the function signature.
    • getDFVariablesInClosure

      public Map<Name,JSoundDataFrame> getDFVariablesInClosure()
      Description copied from interface: Item
      Returns the DataFrame variable bindings, if it is a function item.
      Specified by:
      getDFVariablesInClosure in interface Item
      Returns:
      the function signature.
    • getModuleDynamicContext

      public DynamicContext getModuleDynamicContext()
      Description copied from interface: Item
      Returns the module dynamic context, if it is a function item.
      Specified by:
      getModuleDynamicContext in interface Item
      Returns:
      the function signature.
    • hasTimeZone

      public boolean hasTimeZone()
      Specified by:
      hasTimeZone in interface Item
      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 interface Item
      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 interface Item
      Returns:
      the effective boolean value.
    • putItem

      public void putItem(Item item)
      Description copied from interface: Item
      Appends an item, if it is an array.
      Specified by:
      putItem in interface Item
      Parameters:
      item - an item.
    • append

      public void append(Item value)
      Description copied from interface: Item
      Adds a value pair, if it is an array item.
      Specified by:
      append in interface Item
      Parameters:
      value - a value.
    • putItemByKey

      public void putItemByKey(String key, Item value)
      Description copied from interface: Item
      Adds a key-value pair, if it is an object item.
      Specified by:
      putItemByKey in interface Item
      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 interface Item
      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 interface Item
      Returns:
      the float value.
    • castToDecimalValue

      public BigDecimal castToDecimalValue()
      Description copied from interface: Item
      Casts the item to a decimal value (must be a numeric).
      Specified by:
      castToDecimalValue in interface Item
      Returns:
      the BigDecimal value.
    • castToIntegerValue

      public BigInteger castToIntegerValue()
      Description copied from interface: Item
      Casts the item to a big integer value (must be a numeric).
      Specified by:
      castToIntegerValue in interface Item
      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 interface Item
      Returns:
      the int value.
    • generateNativeQuery

      public NativeClauseContext generateNativeQuery(NativeClauseContext context)
      Description copied from interface: Item
      Get sparkSql string for the item
      Specified by:
      generateNativeQuery in interface Item
      Parameters:
      context - input context
      Returns:
      String representing the item in a sparksql query or null if it is not supported for the item
    • getSparkSQLValue

      public String getSparkSQLValue()
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      Specified by:
      getSparkSQLValue in interface Item
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLValue

      public String getSparkSQLValue(ItemType itemType)
      Description copied from interface: Item
      Returns the SparkSQL value of the item for use in a query.
      Specified by:
      getSparkSQLValue in interface Item
      Returns:
      String representing the SparkSQL value of the item.
    • getSparkSQLType

      public String getSparkSQLType()
      Description copied from interface: Item
      Returns the SparkSQL type of the item for use in a query.
      Specified by:
      getSparkSQLType in interface Item
      Returns:
      String representing the SparkSQL type of the item.
    • putItemAt

      public void putItemAt(Item item, int i)
      Description copied from interface: Item
      Add an item at index i, if it is an array.
      Specified by:
      putItemAt in interface Item
      Parameters:
      item - an item.
      i - an integer.
    • putItemsAt

      public void putItemsAt(List<Item> items, int i)
      Description copied from interface: Item
      Add all items in items at index i, if it is an array.
      Specified by:
      putItemsAt in interface Item
      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 interface Item
      Parameters:
      i - an integer.
    • removeItemByKey

      public void removeItemByKey(String key)
      Description copied from interface: Item
      Removes a key-value pair, if it is an object item.
      Specified by:
      removeItemByKey in interface Item
      Parameters:
      key - a key.
    • getMutabilityLevel

      public int getMutabilityLevel()
      Description copied from interface: Item
      Returns the mutability level of the item.
      Specified by:
      getMutabilityLevel in interface Item
      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 interface Item
      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 interface Item
      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 interface Item
      Parameters:
      topLevelID - new top level ID.
    • getPathIn

      public String getPathIn()
      Description copied from interface: Item
      Returns the path from the top level object of a DeltaFile for the item.
      Specified by:
      getPathIn in interface Item
      Returns:
      String representing the path of the item from the top level within a DeltaFile.
    • setPathIn

      public void setPathIn(String pathIn)
      Description copied from interface: Item
      Sets the path from the top level object of a DeltaFile for the item to a supplied value.
      Specified by:
      setPathIn in interface Item
      Parameters:
      pathIn - new path from top level.
    • getTableLocation

      public String getTableLocation()
      Description copied from interface: Item
      Returns the location of the DeltaFile for the item.
      Specified by:
      getTableLocation in interface Item
      Returns:
      String representing the location of the DeltaFile for the item.
    • setTableLocation

      public void setTableLocation(String location)
      Description copied from interface: Item
      Sets the location of the DeltaFile for the item to a supplied value.
      Specified by:
      setTableLocation in interface Item
      Parameters:
      location - new location of the DeltaFile for the item.