Package org.basex.query.value.type
Enum Class AtomType
- All Implemented Interfaces:
Serializable,Comparable<AtomType>,java.lang.constant.Constable,Type
XQuery atomic 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 ConstantsEnum ConstantDescriptionAny atomic type.Any simple type.Any type.Any URI type.Base64 binary type.Implementation specific: binary type.Boolean type.Byte type.Date type.DateTime type.DateTimeStamp type.Day time duration type.Decimal type.Double type.Duration type.Entity type.Float type.Day type.Month type.Month day type.Year type.Year month type.Hex binary type.ID type.IDREF type.Int type.Integer type.Item type.Java type.Language type.Long type.Name type.NCName type.Negative integer type.NMTOKEN type.Non-negative integer type.Non-positive integer type.Normalized String type.NOTATION Type.Numeric type.Positive integer type.Precision decimal type.QName Type.Short type.String type.Time type.Token type.Unsigned byte type.Short type.Unsigned long type.Unsigned Short type.Untyped type.Untyped Atomic type.Year month duration type. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal AtomTypeatomic()Returns the atomic type.cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified Java value to this type.cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified item to this type.final QueryExceptionReturns a cast exception.final QueryExceptionReturns a cast exception.final ItemcastString(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 AtomTypeFinds and returns the specified type.final Type.IDid()Returns a type id to differentiate all types.final booleaninstanceOf(Type type) 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.final QNmqname()Returns the name of a node type.final SeqTypeInternal function for creating a sequence type with the specified occurrence indicator.static byte[]Returns an info message for a similar function.final StringtoString()final TypeComputes the union between this type and the given one, i.e.static AtomTypeReturns the enum constant of this class with the specified name.static AtomType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ITEM
Item type. -
UNTYPED
Untyped type. -
ANY_TYPE
Any type. -
ANY_SIMPLE_TYPE
Any simple type. -
ANY_ATOMIC_TYPE
Any atomic type. -
UNTYPED_ATOMIC
Untyped Atomic type. -
STRING
String type. -
NORMALIZED_STRING
Normalized String type. -
TOKEN
Token type. -
LANGUAGE
Language type. -
NMTOKEN
NMTOKEN type. -
NAME
Name type. -
NCNAME
NCName type. -
ID
ID type. -
IDREF
IDREF type. -
ENTITY
Entity type. -
NUMERIC
Numeric type. -
FLOAT
Float type. -
DOUBLE
Double type. -
DECIMAL
Decimal type. -
PRECISION_DECIMAL
Precision decimal type. -
INTEGER
Integer type. -
NON_POSITIVE_INTEGER
Non-positive integer type. -
NEGATIVE_INTEGER
Negative integer type. -
LONG
Long type. -
INT
Int type. -
SHORT
Short type. -
BYTE
Byte type. -
NON_NEGATIVE_INTEGER
Non-negative integer type. -
UNSIGNED_LONG
Unsigned long type. -
UNSIGNED_INT
Short type. -
UNSIGNED_SHORT
Unsigned Short type. -
UNSIGNED_BYTE
Unsigned byte type. -
POSITIVE_INTEGER
Positive integer type. -
DURATION
Duration type. -
YEAR_MONTH_DURATION
Year month duration type. -
DAY_TIME_DURATION
Day time duration type. -
DATE_TIME
DateTime type. -
DATE_TIME_STAMP
DateTimeStamp type. -
DATE
Date type. -
TIME
Time type. -
G_YEAR_MONTH
Year month type. -
G_YEAR
Year type. -
G_MONTH_DAY
Month day type. -
G_DAY
Day type. -
G_MONTH
Month type. -
BOOLEAN
Boolean type. -
BINARY
Implementation specific: binary type. -
BASE64_BINARY
Base64 binary type. -
HEX_BINARY
Hex binary type. -
ANY_URI
Any URI type. -
QNAME
QName Type. -
NOTATION
NOTATION Type. -
JAVA
Java type.
-
-
Field Details
-
VALUES
Cached enums (faster).
-
-
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
-
cast
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 Item 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 Item 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. -
qname
Returns the name of a node type.- Returns:
- name
-
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:
type- 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. -
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
-
atomic
Description copied from interface:TypeReturns the atomic type. -
id
Description copied from interface:TypeReturns a type id to differentiate all types. -
castError
Returns a cast exception.- Parameters:
item- item to be convertedii- input info- Returns:
- query exception
-
castError
Returns a cast exception.- Parameters:
value- value to be convertedii- input info- Returns:
- query exception
-
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 typeall- accept all types (including those without parent type)- Returns:
- type or
null
-
similar
Returns an info message for a similar function.- Parameters:
qname- name of type- Returns:
- info string
-