Package org.rumbledb.types
Class AtomicItemType
java.lang.Object
org.rumbledb.types.AbstractItemType
org.rumbledb.types.AtomicItemType
- All Implemented Interfaces:
Serializable,ItemType
This class describes all the primitive built-in atomic types in the JSONiq data model.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanBePromotedTo(ItemType other) Casting-specific primitive normalization used by cast/castable logic.Returns the lexical-space patterns for this item type.getName()Returns the pattern facet for this item type.Returns the SparkSQL type of the item type for use in a query.intbooleanhasName()Tests for QName.booleanbooleanCasting-specific primitive notion from XPath/XQuery Functions and Operators 3.1 §19: in addition to XML Schema primitive types, xs:integer, xs:yearMonthDuration, and xs:dayTimeDuration are treated as primitive for casting.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 typetoString()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
findLeastCommonSuperTypeLax, findLeastCommonSuperTypeWith, getArrayContentFacet, getClosedFacet, getIdentifierString, getMapKeyItemType, getMapValueSequenceType, getMemberSequenceType, getObjectContentFacet, getObjectContentFacet, getObjectContentFacetAsUnorderedMap, getObjectKeysFacet, getSignature, getSingleNullableType, getTypes, isArrayItemType, isEqualTo, isFunctionItemType, isJsonItemType, isMapItemType, isNodeItemType, isObjectItemType, isSubtypeOf, isTopmostItemType, isUnionType, isUserDefined, isXQueryArrayItemType, resolve, resolve
-
Method Details
-
isAtomicItemType
public boolean isAtomicItemType()- Returns:
- true it [this] is a subtype of an atomic item type.
-
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
-
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
-
isCastingPrimitive
public boolean isCastingPrimitive()Description copied from interface:ItemTypeCasting-specific primitive notion from XPath/XQuery Functions and Operators 3.1 §19: in addition to XML Schema primitive types, xs:integer, xs:yearMonthDuration, and xs:dayTimeDuration are treated as primitive for casting.- Returns:
- [true] if this type is considered primitive for casting semantics.
-
getCastingPrimitiveType
Description copied from interface:ItemTypeCasting-specific primitive normalization used by cast/castable logic.- Returns:
- this type if it is a casting primitive; otherwise its casting primitive ancestor.
-
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
-
isNumeric
public boolean isNumeric()- Returns:
- [true] if this is a numeric item type, false otherwise
-
canBePromotedTo
- Parameters:
other- another item type- Returns:
- true if [this] can be promoted to [itemType]
-
getAllowedFacets
- Returns:
- a set containing the allowed facets for restricting the type
-
getEnumerationFacet
- Returns:
- the list of possible values for [this] item type or null if the enumeration facet is not set
-
getConstraintsFacet
- 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
- Returns:
- the minimum length facet value for [this] item type or null if the restriction is not set
-
getLengthFacet
- Returns:
- the length facet value for [this] item type or null if the restriction is not set
-
getMaxLengthFacet
- Returns:
- the maximum length facet value for [this] item type or null if the restriction is not set
-
getMinExclusiveFacet
- Returns:
- an item representing the minimum possible value (excluded) for [this] item type or null if the restriction is not set
-
getMinInclusiveFacet
- Returns:
- an item representing the minimum possible value (included) for [this] item type or null if the restriction is not set
-
getMaxExclusiveFacet
- Returns:
- an item representing the maximum possible value (excluded) for [this] item type or null if the restriction is not set
-
getMaxInclusiveFacet
- Returns:
- an item representing the maximum possible value (included) for [this] item type or null if the restriction is not set
-
getTotalDigitsFacet
- Returns:
- the total digits facet value for [this] item type or null if the restriction is not set
-
getFractionDigitsFacet
- Returns:
- the fraction digits facet value for [this] item type or null if the restriction is not set
-
getExplicitTimezoneFacet
- Returns:
- the explicit timezone facet value for [this] item type or null if the restriction is not set
-
getWhitespaceFacet
- Returns:
- the whiteSpace facet value for [this] item type or null if the restriction is not set
-
getPatternFacet
Description copied from interface:ItemTypeReturns the pattern facet for this item type. This reflects pattern facets applied via derivation (for example onDerivedAtomicItemType), not the full lexical space of a primitive atomic type.- Returns:
- the list of pattern regex strings for this derivation step, or null if no pattern restriction is set
-
getOrderedFacet
- Returns:
- the ordered fundamental facet value, or null if not set
-
getBoundedFacet
- Returns:
- the bounded fundamental facet value, or null if not set
-
getCardinalityFacet
- Returns:
- the cardinality fundamental facet value, or null if not set
-
getNumericFacet
- Returns:
- the numeric fundamental facet value, or null if not set
-
getLexicalSpacePatterns
Description copied from interface:ItemTypeReturns the lexical-space patterns for this item type. For primitive atomic types, this describes the lexical space defined by the specification (for example, the allowed literals for xs:boolean or the lexical grammar for xs:decimal). For derived atomic types, this typically delegates to the primitive type. Implementations that do not provide additional constraints should return an empty list.- Returns:
- a list of regular expressions describing the lexical space of this type, or an empty list if no regex-based restriction is modeled.
-
toString
-
isResolved
public boolean isResolved() -
isCompatibleWithDataFrames
Description copied from interface:ItemTypeChecks compatibility with DataFrames.- Returns:
- true if compatible with DataFrames and false otherwise.
-
getSparkSQLType
Description copied from interface:ItemTypeReturns the SparkSQL type of the item type for use in a query.- Returns:
- String representing the SparkSQL type of the item type.
-
canBeNull
public boolean canBeNull()- Returns:
- [true] if the null value is in the value space.
-