Class UnionItemType

java.lang.Object
org.rumbledb.types.AbstractItemType
org.rumbledb.types.UnionItemType
All Implemented Interfaces:
Serializable, ItemType

public class UnionItemType extends AbstractItemType
See Also:
  • Method Details

    • isUnionType

      public boolean isUnionType()
    • hasName

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

      public Name getName()
      Returns:
      the itemtype QName if available
    • getTypeTreeDepth

      public int getTypeTreeDepth()
      Returns:
      an int representing the depth of the item type in the type tree ('item' is the root with depth 0)
    • getBaseType

      public ItemType getBaseType()
      Returns:
      the base type for a type, return null for the topmost item type
    • isUserDefined

      public boolean isUserDefined()
      Returns:
      [true] if it is a user-defined type, false otherwise
    • isNumeric

      public boolean isNumeric()
      Returns:
      [true] if this is a numeric item type, false otherwise
    • 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
      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
    • isPrimitive

      public boolean isPrimitive()
      Returns:
      [true] if it is a primitive type
    • getPrimitiveType

      public ItemType getPrimitiveType()
      Returns:
      the primitive type for a derived type, throw an error for primitive types
    • getAllowedFacets

      public Set<ConstrainingFacetTypes> getAllowedFacets()
      Returns:
      a set containing the allowed facets for restricting the type
    • getTypes

      public List<ItemType> getTypes()
      Returns:
      content facet value for union item types
    • getIdentifierString

      public String getIdentifierString()
      Returns:
      a String that uniquely identify an item type
    • toString

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

      public boolean isResolved()
    • resolve

      public void resolve(DynamicContext context, ExceptionMetadata metadata)
    • resolve

      public void resolve(StaticContext context, ExceptionMetadata metadata)
    • isCompatibleWithDataFrames

      public boolean isCompatibleWithDataFrames(RumbleConfiguration configuration)
      Description copied from interface: ItemType
      Checks compatibility with DataFrames.
      Returns:
      true if compatible with DataFrames and false otherwise.
    • findLeastCommonSuperTypeWith

      public ItemType findLeastCommonSuperTypeWith(ItemType other)
      Parameters:
      other - another item type
      Returns:
      the common supertype between [this] and [other], that would be the LCA in the item type tree of [this] and [other] (does not take into account union types as common ancestor, but only the type tree)
    • canBeNull

      public boolean canBeNull()
      Returns:
      [true] if the null value is in the value space.
    • getSingleNullableType

      public ItemType getSingleNullableType()
      Returns:
      [true] if this is just one type unioned with null, returns that type.