Enum Class AtomType

java.lang.Object
java.lang.Enum<AtomType>
org.basex.query.value.type.AtomType
All Implemented Interfaces:
Serializable, Comparable<AtomType>, java.lang.constant.Constable, Type

public enum AtomType extends Enum<AtomType> implements Type
XQuery atomic types.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Enum Constant Details

    • ITEM

      public static final AtomType ITEM
      Item type.
    • UNTYPED

      public static final AtomType UNTYPED
      Untyped type.
    • ANY_TYPE

      public static final AtomType ANY_TYPE
      Any type.
    • ANY_SIMPLE_TYPE

      public static final AtomType ANY_SIMPLE_TYPE
      Any simple type.
    • ANY_ATOMIC_TYPE

      public static final AtomType ANY_ATOMIC_TYPE
      Any atomic type.
    • UNTYPED_ATOMIC

      public static final AtomType UNTYPED_ATOMIC
      Untyped Atomic type.
    • STRING

      public static final AtomType STRING
      String type.
    • NORMALIZED_STRING

      public static final AtomType NORMALIZED_STRING
      Normalized String type.
    • TOKEN

      public static final AtomType TOKEN
      Token type.
    • LANGUAGE

      public static final AtomType LANGUAGE
      Language type.
    • NMTOKEN

      public static final AtomType NMTOKEN
      NMTOKEN type.
    • NAME

      public static final AtomType NAME
      Name type.
    • NCNAME

      public static final AtomType NCNAME
      NCName type.
    • ID

      public static final AtomType ID
      ID type.
    • IDREF

      public static final AtomType IDREF
      IDREF type.
    • ENTITY

      public static final AtomType ENTITY
      Entity type.
    • NUMERIC

      public static final AtomType NUMERIC
      Numeric type.
    • FLOAT

      public static final AtomType FLOAT
      Float type.
    • DOUBLE

      public static final AtomType DOUBLE
      Double type.
    • DECIMAL

      public static final AtomType DECIMAL
      Decimal type.
    • PRECISION_DECIMAL

      public static final AtomType PRECISION_DECIMAL
      Precision decimal type.
    • INTEGER

      public static final AtomType INTEGER
      Integer type.
    • NON_POSITIVE_INTEGER

      public static final AtomType NON_POSITIVE_INTEGER
      Non-positive integer type.
    • NEGATIVE_INTEGER

      public static final AtomType NEGATIVE_INTEGER
      Negative integer type.
    • LONG

      public static final AtomType LONG
      Long type.
    • INT

      public static final AtomType INT
      Int type.
    • SHORT

      public static final AtomType SHORT
      Short type.
    • BYTE

      public static final AtomType BYTE
      Byte type.
    • NON_NEGATIVE_INTEGER

      public static final AtomType NON_NEGATIVE_INTEGER
      Non-negative integer type.
    • UNSIGNED_LONG

      public static final AtomType UNSIGNED_LONG
      Unsigned long type.
    • UNSIGNED_INT

      public static final AtomType UNSIGNED_INT
      Short type.
    • UNSIGNED_SHORT

      public static final AtomType UNSIGNED_SHORT
      Unsigned Short type.
    • UNSIGNED_BYTE

      public static final AtomType UNSIGNED_BYTE
      Unsigned byte type.
    • POSITIVE_INTEGER

      public static final AtomType POSITIVE_INTEGER
      Positive integer type.
    • DURATION

      public static final AtomType DURATION
      Duration type.
    • YEAR_MONTH_DURATION

      public static final AtomType YEAR_MONTH_DURATION
      Year month duration type.
    • DAY_TIME_DURATION

      public static final AtomType DAY_TIME_DURATION
      Day time duration type.
    • DATE_TIME

      public static final AtomType DATE_TIME
      DateTime type.
    • DATE_TIME_STAMP

      public static final AtomType DATE_TIME_STAMP
      DateTimeStamp type.
    • DATE

      public static final AtomType DATE
      Date type.
    • TIME

      public static final AtomType TIME
      Time type.
    • G_YEAR_MONTH

      public static final AtomType G_YEAR_MONTH
      Year month type.
    • G_YEAR

      public static final AtomType G_YEAR
      Year type.
    • G_MONTH_DAY

      public static final AtomType G_MONTH_DAY
      Month day type.
    • G_DAY

      public static final AtomType G_DAY
      Day type.
    • G_MONTH

      public static final AtomType G_MONTH
      Month type.
    • BOOLEAN

      public static final AtomType BOOLEAN
      Boolean type.
    • BINARY

      public static final AtomType BINARY
      Implementation specific: binary type.
    • BASE64_BINARY

      public static final AtomType BASE64_BINARY
      Base64 binary type.
    • HEX_BINARY

      public static final AtomType HEX_BINARY
      Hex binary type.
    • ANY_URI

      public static final AtomType ANY_URI
      Any URI type.
    • QNAME

      public static final AtomType QNAME
      QName Type.
    • NOTATION

      public static final AtomType NOTATION
      NOTATION Type.
    • JAVA

      public static final AtomType JAVA
      Java type.
  • Field Details

    • VALUES

      public static final AtomType[] VALUES
      Cached enums (faster).
  • Method Details

    • values

      public static AtomType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AtomType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • cast

      public Item cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Description copied from interface: Type
      Casts the specified item to this type.
      Specified by:
      cast in interface Type
      Parameters:
      item - item to be converted
      qc - query context
      sc - static context
      ii - input info
      Returns:
      cast value
      Throws:
      QueryException - query exception
    • cast

      public Item cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Description copied from interface: Type
      Casts the specified Java value to this type.
      Specified by:
      cast in interface Type
      Parameters:
      value - Java value
      qc - query context
      sc - static context
      ii - input info
      Returns:
      cast value
      Throws:
      QueryException - query exception
    • castString

      public final Item castString(String value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Description copied from interface: Type
      Casts the specified string to this type.
      Specified by:
      castString in interface Type
      Parameters:
      value - string object
      qc - query context
      sc - static context
      ii - input info
      Returns:
      cast value
      Throws:
      QueryException - query exception
    • seqType

      public final SeqType seqType(Occ occ)
      Description copied from interface: Type
      Internal function for creating a sequence type with the specified occurrence indicator.
      Specified by:
      seqType in interface Type
      Parameters:
      occ - occurrence indicator
      Returns:
      sequence type
      See Also:
    • qname

      public final QNm qname()
      Returns the name of a node type.
      Returns:
      name
    • eq

      public final boolean eq(Type type)
      Description copied from interface: Type
      Checks if this type is equal to the given one.
      Specified by:
      eq in interface Type
      Parameters:
      type - other type
      Returns:
      true if both types are equal, false otherwise
    • instanceOf

      public final boolean instanceOf(Type type)
      Description copied from interface: Type
      Checks if the current type is an instance of the specified type.
      Specified by:
      instanceOf in interface Type
      Parameters:
      type - type to be checked
      Returns:
      result of check
    • union

      public final Type union(Type type)
      Description copied from interface: Type
      Computes the union between this type and the given one, i.e. the least common ancestor of both types in the type hierarchy.
      Specified by:
      union in interface Type
      Parameters:
      type - other type
      Returns:
      union type
    • intersect

      public final Type intersect(Type type)
      Description copied from interface: Type
      Computes the intersection between this type and the given one, i.e. the least specific type that is sub-type of both types. If no such type exists, null is returned.
      Specified by:
      intersect in interface Type
      Parameters:
      type - other type
      Returns:
      intersection type or null
    • isNumber

      public final boolean isNumber()
      Description copied from interface: Type
      Checks if items with this type are numbers.
      Specified by:
      isNumber in interface Type
      Returns:
      result of check
    • isUntyped

      public final boolean isUntyped()
      Description copied from interface: Type
      Checks if items with this type are untyped.
      Specified by:
      isUntyped in interface Type
      Returns:
      result of check
    • isNumberOrUntyped

      public final boolean isNumberOrUntyped()
      Description copied from interface: Type
      Checks if items with this type are numbers or untyped.
      Specified by:
      isNumberOrUntyped in interface Type
      Returns:
      result of check
    • isStringOrUntyped

      public final boolean isStringOrUntyped()
      Description copied from interface: Type
      Checks if items of this type are strings or untyped. Returns if this item is untyped or a string.
      Specified by:
      isStringOrUntyped in interface Type
      Returns:
      result of check
    • isSortable

      public final boolean isSortable()
      Description copied from interface: Type
      Checks if items of this type are sortable.
      Specified by:
      isSortable in interface Type
      Returns:
      result of check
    • atomic

      public final AtomType atomic()
      Description copied from interface: Type
      Returns the atomic type.
      Specified by:
      atomic in interface Type
      Returns:
      atomic type (can be null, e.g. for function types)
    • id

      public final Type.ID id()
      Description copied from interface: Type
      Returns a type id to differentiate all types.
      Specified by:
      id in interface Type
      Returns:
      id
    • castError

      public final QueryException castError(Item item, InputInfo ii)
      Returns a cast exception.
      Parameters:
      item - item to be converted
      ii - input info
      Returns:
      query exception
    • castError

      public final QueryException castError(byte[] value, InputInfo ii)
      Returns a cast exception.
      Parameters:
      value - value to be converted
      ii - input info
      Returns:
      query exception
    • nsSensitive

      public final boolean nsSensitive()
      Description copied from interface: Type
      Checks if the type is namespace-sensitive.
      Specified by:
      nsSensitive in interface Type
      Returns:
      result of check
    • toString

      public final String toString()
      Specified by:
      toString in interface Type
      Overrides:
      toString in class Enum<AtomType>
    • find

      public static AtomType find(QNm qname, boolean all)
      Finds and returns the specified type.
      Parameters:
      qname - name of type
      all - accept all types (including those without parent type)
      Returns:
      type or null
    • similar

      public static byte[] similar(QNm qname)
      Returns an info message for a similar function.
      Parameters:
      qname - name of type
      Returns:
      info string