Package org.basex.query.value.type
Enum Class ListType
- All Implemented Interfaces:
Serializable,Comparable<ListType>,java.lang.constant.Constable,Type
XQuery list types.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionfinal AtomTypeatomic()Returns the atomic type.final Valuecast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified Java value to this type.final Valuecast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified item to this type.final ValuecastString(String value, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified string to this type.final booleanChecks if this type is equal to the given one.static ListTypeFinds and returns the specified type.final Type.IDid()Returns a type id to differentiate all types.final booleaninstanceOf(Type tp) Checks if the current type is an instance of the specified type.final TypeComputes the intersection between this type and the given one, i.e.final booleanisNumber()Checks if items with this type are numbers.final booleanChecks if items with this type are numbers or untyped.final booleanChecks if items of this type are sortable.final booleanChecks if items of this type are strings or untyped.final booleanChecks if items with this type are untyped.final booleanChecks if the type is namespace-sensitive.Internal function for creating a sequence type with the specified occurrence indicator.final StringtoString()final TypeComputes the union between this type and the given one, i.e.static ListTypeReturns the enum constant of this class with the specified name.static ListType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NMTOKENS
NMTOKENS type. -
ENTITIES
ENTITIES type. -
IDREFS
IDREFS type.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
isNumber
public final boolean isNumber()Description copied from interface:TypeChecks if items with this type are numbers. -
isUntyped
public final boolean isUntyped()Description copied from interface:TypeChecks if items with this type are untyped. -
isNumberOrUntyped
public final boolean isNumberOrUntyped()Description copied from interface:TypeChecks if items with this type are numbers or untyped.- Specified by:
isNumberOrUntypedin interfaceType- Returns:
- result of check
-
isStringOrUntyped
public final boolean isStringOrUntyped()Description copied from interface:TypeChecks if items of this type are strings or untyped. Returns if this item is untyped or a string.- Specified by:
isStringOrUntypedin interfaceType- Returns:
- result of check
-
isSortable
public final boolean isSortable()Description copied from interface:TypeChecks if items of this type are sortable.- Specified by:
isSortablein interfaceType- Returns:
- result of check
-
cast
public final Value cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException Description copied from interface:TypeCasts the specified item to this type.- Specified by:
castin interfaceType- Parameters:
item- item to be convertedqc- query contextsc- static contextii- 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:TypeCasts the specified Java value to this type.- Specified by:
castin interfaceType- Parameters:
value- Java valueqc- query contextsc- static contextii- 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:TypeCasts the specified string to this type.- Specified by:
castStringin interfaceType- Parameters:
value- string objectqc- query contextsc- static contextii- input info- Returns:
- cast value
- Throws:
QueryException- query exception
-
seqType
Description copied from interface:TypeInternal function for creating a sequence type with the specified occurrence indicator. -
eq
Description copied from interface:TypeChecks if this type is equal to the given one. -
instanceOf
Description copied from interface:TypeChecks if the current type is an instance of the specified type.- Specified by:
instanceOfin interfaceType- Parameters:
tp- type to be checked- Returns:
- result of check
-
union
Description copied from interface:TypeComputes the union between this type and the given one, i.e. the least common ancestor of both types in the type hierarchy. -
intersect
Description copied from interface:TypeComputes 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,nullis returned. -
atomic
Description copied from interface:TypeReturns the atomic type. -
id
Description copied from interface:TypeReturns a type id to differentiate all types. -
nsSensitive
public final boolean nsSensitive()Description copied from interface:TypeChecks if the type is namespace-sensitive.- Specified by:
nsSensitivein interfaceType- Returns:
- result of check
-
toString
-
find
Finds and returns the specified type.- Parameters:
qname- name of type- Returns:
- type or
null
-