Enum Class ListType

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

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

    • NMTOKENS

      public static final ListType NMTOKENS
      NMTOKENS type.
    • ENTITIES

      public static final ListType ENTITIES
      ENTITIES type.
    • IDREFS

      public static final ListType IDREFS
      IDREFS type.
  • Method Details

    • values

      public static ListType[] 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 ListType 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
    • 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
    • cast

      public final Value 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 final Value 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 Value 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 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:
    • eq

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

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

      public final Type union(Type tp)
      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:
      tp - other type
      Returns:
      union type
    • intersect

      public final Type intersect(Type tp)
      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:
      tp - other type
      Returns:
      intersection type or null
    • 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
    • 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<ListType>
    • find

      public static ListType find(QNm qname)
      Finds and returns the specified type.
      Parameters:
      qname - name of type
      Returns:
      type or null