Class DerivedAtomicItemType

java.lang.Object
org.rumbledb.types.DerivedAtomicItemType
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable, ItemType

public class DerivedAtomicItemType extends Object implements ItemType, com.esotericsoftware.kryo.KryoSerializable
See Also:
  • Method Details

    • 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
    • equals

      public boolean equals(Object other)
      Description copied from interface: ItemType
      Tests for itemType equality.
      Specified by:
      equals in interface ItemType
      Overrides:
      equals in class Object
      Parameters:
      other - another object.
      Returns:
      true it is equal to other, false otherwise.
    • isAtomicItemType

      public boolean isAtomicItemType()
      Specified by:
      isAtomicItemType in interface ItemType
      Returns:
      true it [this] is a subtype of an atomic item type.
    • isNumeric

      public boolean isNumeric()
      Specified by:
      isNumeric in interface ItemType
      Returns:
      [true] if this is a numeric item type, false otherwise
    • hasName

      public boolean hasName()
      Description copied from interface: ItemType
      Tests for QName.
      Specified by:
      hasName in interface ItemType
      Returns:
      true if [this] item type has a QName
    • getName

      public Name getName()
      Specified by:
      getName in interface ItemType
      Returns:
      the itemtype QName if available
    • getTypeTreeDepth

      public int getTypeTreeDepth()
      Specified by:
      getTypeTreeDepth in interface ItemType
      Returns:
      an int representing the depth of the item type in the type tree ('item' is the root with depth 0)
    • isStaticallyCastableAs

      public boolean isStaticallyCastableAs(ItemType other)
      Description copied from interface: ItemType
      Check at static time if [this] could be casted to [other] item type, requires [this] to be an atomic type
      Specified by:
      isStaticallyCastableAs in interface ItemType
      Parameters:
      other - a strict subtype of atomic item type to which we are trying to cast
      Returns:
      true if it is possible at static time to cast [this] to [other], false otherwise
    • canBePromotedTo

      public boolean canBePromotedTo(ItemType other)
      Specified by:
      canBePromotedTo in interface ItemType
      Parameters:
      other - another item type
      Returns:
      true if [this] can be promoted to [itemType]
    • isUserDefined

      public boolean isUserDefined()
      Specified by:
      isUserDefined in interface ItemType
      Returns:
      [true] if it is a user-defined type, false otherwise
    • isPrimitive

      public boolean isPrimitive()
      Specified by:
      isPrimitive in interface ItemType
      Returns:
      [true] if it is a primitive type
    • getPrimitiveType

      public ItemType getPrimitiveType()
      Specified by:
      getPrimitiveType in interface ItemType
      Returns:
      the primitive type for a derived type, throw an error for primitive types
    • getBaseType

      public ItemType getBaseType()
      Specified by:
      getBaseType in interface ItemType
      Returns:
      the base type for a type, return null for the topmost item type
    • getAllowedFacets

      public Set<FacetTypes> getAllowedFacets()
      Specified by:
      getAllowedFacets in interface ItemType
      Returns:
      a set containing the allowed facets for restricting the type
    • getEnumerationFacet

      public List<Item> getEnumerationFacet()
      Specified by:
      getEnumerationFacet in interface ItemType
      Returns:
      the list of possible values for [this] item type or null if the enumeration facet is not set
    • getConstraintsFacet

      public List<String> getConstraintsFacet()
      Specified by:
      getConstraintsFacet in interface ItemType
      Returns:
      the list of constraints in the implementation-defined language for [this] item type (note that this facet is cumulative) or an empty list if the constraints facet is not set
    • getMinLengthFacet

      public Integer getMinLengthFacet()
      Specified by:
      getMinLengthFacet in interface ItemType
      Returns:
      the minimum length facet value for [this] item type or null if the restriction is not set
    • getLengthFacet

      public Integer getLengthFacet()
      Specified by:
      getLengthFacet in interface ItemType
      Returns:
      the length facet value for [this] item type or null if the restriction is not set
    • getMaxLengthFacet

      public Integer getMaxLengthFacet()
      Specified by:
      getMaxLengthFacet in interface ItemType
      Returns:
      the maximum length facet value for [this] item type or null if the restriction is not set
    • getMinExclusiveFacet

      public Item getMinExclusiveFacet()
      Specified by:
      getMinExclusiveFacet in interface ItemType
      Returns:
      an item representing the minimum possible value (excluded) for [this] item type or null if the restriction is not set
    • getMinInclusiveFacet

      public Item getMinInclusiveFacet()
      Specified by:
      getMinInclusiveFacet in interface ItemType
      Returns:
      an item representing the minimum possible value (included) for [this] item type or null if the restriction is not set
    • getMaxExclusiveFacet

      public Item getMaxExclusiveFacet()
      Specified by:
      getMaxExclusiveFacet in interface ItemType
      Returns:
      an item representing the maximum possible value (excluded) for [this] item type or null if the restriction is not set
    • getMaxInclusiveFacet

      public Item getMaxInclusiveFacet()
      Specified by:
      getMaxInclusiveFacet in interface ItemType
      Returns:
      an item representing the maximum possible value (included) for [this] item type or null if the restriction is not set
    • getTotalDigitsFacet

      public Integer getTotalDigitsFacet()
      Specified by:
      getTotalDigitsFacet in interface ItemType
      Returns:
      the total digits facet value for [this] item type or null if the restriction is not set
    • getFractionDigitsFacet

      public Integer getFractionDigitsFacet()
      Specified by:
      getFractionDigitsFacet in interface ItemType
      Returns:
      the fraction digits facet value for [this] item type or null if the restriction is not set
    • getExplicitTimezoneFacet

      public TimezoneFacet getExplicitTimezoneFacet()
      Specified by:
      getExplicitTimezoneFacet in interface ItemType
      Returns:
      the explicit timezone facet value for [this] item type or null if the restriction is not set
    • getIdentifierString

      public String getIdentifierString()
      Specified by:
      getIdentifierString in interface ItemType
      Returns:
      a String that uniquely identify an item type
    • toString

      public String toString()
      Specified by:
      toString in interface ItemType
      Overrides:
      toString in class Object
    • isCompatibleWithDataFrames

      public boolean isCompatibleWithDataFrames(RumbleRuntimeConfiguration configuration)
      Description copied from interface: ItemType
      Checks compatibility with DataFrames.
      Specified by:
      isCompatibleWithDataFrames in interface ItemType
      Returns:
      true if compatible with DataFrames and false otherwise.
    • resolve

      public void resolve(DynamicContext context, ExceptionMetadata metadata)
      Specified by:
      resolve in interface ItemType
    • resolve

      public void resolve(StaticContext context, ExceptionMetadata metadata)
      Specified by:
      resolve in interface ItemType
    • processBaseType

      public void processBaseType()
    • getSparkSQLType

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