Package org.rumbledb.types
Class UnionItemType
java.lang.Object
org.rumbledb.types.AbstractItemType
org.rumbledb.types.UnionItemType
- All Implemented Interfaces:
Serializable,ItemType
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()getTypes()intbooleanhasName()Tests for QName.booleanisCompatibleWithDataFrames(RumbleConfiguration configuration) Checks compatibility with DataFrames.booleanbooleanbooleanbooleanisStaticallyCastableAs(ItemType other) Check at static time if [this] could be casted to [other] item type, requires [this] to be an atomic typebooleanbooleanvoidresolve(DynamicContext context, ExceptionMetadata metadata) voidresolve(StaticContext context, ExceptionMetadata metadata) toString()Methods inherited from class org.rumbledb.types.AbstractItemType
equalityKey, equalityKeyOf, equals, hashCode, namedTypeKey, structuralTypeKeyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.rumbledb.types.ItemType
canBePromotedTo, findLeastCommonSuperTypeLax, getArrayContentFacet, getBoundedFacet, getCardinalityFacet, getCastingPrimitiveType, getClosedFacet, getConstraintsFacet, getEnumerationFacet, getExplicitTimezoneFacet, getFractionDigitsFacet, getLengthFacet, getLexicalSpacePatterns, getMapKeyItemType, getMapValueSequenceType, getMaxExclusiveFacet, getMaxInclusiveFacet, getMaxLengthFacet, getMemberSequenceType, getMinExclusiveFacet, getMinInclusiveFacet, getMinLengthFacet, getNumericFacet, getObjectContentFacet, getObjectContentFacet, getObjectContentFacetAsUnorderedMap, getObjectKeysFacet, getOrderedFacet, getPatternFacet, getSignature, getSparkSQLType, getTotalDigitsFacet, getWhitespaceFacet, isArrayItemType, isAtomicItemType, isCastingPrimitive, isEqualTo, isFunctionItemType, isJsonItemType, isMapItemType, isNodeItemType, isObjectItemType, isSubtypeOf, isTopmostItemType, isXQueryArrayItemType
-
Method Details
-
isUnionType
public boolean isUnionType() -
hasName
public boolean hasName()Description copied from interface:ItemTypeTests for QName.- Returns:
- true if [this] item type has a QName
-
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
- 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
Description copied from interface:ItemTypeCheck 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
- Returns:
- the primitive type for a derived type, throw an error for primitive types
-
getAllowedFacets
- Returns:
- a set containing the allowed facets for restricting the type
-
getTypes
- Returns:
- content facet value for union item types
-
getIdentifierString
- Returns:
- a String that uniquely identify an item type
-
toString
-
isResolved
public boolean isResolved() -
resolve
-
resolve
-
isCompatibleWithDataFrames
Description copied from interface:ItemTypeChecks compatibility with DataFrames.- Returns:
- true if compatible with DataFrames and false otherwise.
-
findLeastCommonSuperTypeWith
- 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
- Returns:
- [true] if this is just one type unioned with null, returns that type.
-