Package org.basex.query.value.type
Class FuncType
java.lang.Object
org.basex.query.value.type.FuncType
- All Implemented Interfaces:
Type
XQuery 3.0 function types.
- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Nested Class Summary
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal AtomTypeatomic()Returns the atomic type.final Itemcast(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 ItemcastString(String string, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified string to this type.booleanChecks if this type is equal to the given one.static TypeFinds and returns the specified function type.static FuncTypeGetter for function types.static FuncTypeGetter for a function's type.static FuncTypeGetter for function types without annotations.final Type.IDid()Returns a type id to differentiate all types.booleaninstanceOf(Type type) Checks if the current type is an instance of the specified type.Computes 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.booleanChecks if the type is namespace-sensitive.Internal function for creating a sequence type with the specified occurrence indicator.static byte[]Returns an info message for a similar function.toString()Computes the union between this type and the given one, i.e.
-
Field Details
-
FUNCTION
public static final byte[] FUNCTIONName. -
anns
Annotations. -
declType
Return type of the function. -
argTypes
Argument types (can benull, indicated that no types were specified).
-
-
Method Details
-
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
-
seqType
Description copied from interface:TypeInternal function for creating a sequence type with the specified occurrence indicator. -
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
Description copied from interface:TypeCasts the specified Java value to this type. -
castString
Description copied from interface:TypeCasts the specified string to this type.- Specified by:
castStringin interfaceType- Parameters:
string- string objectqc- query contextsc- static contextii- input info- Returns:
- cast value
-
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. -
get
Getter for function types.- Parameters:
anns- annotationsdeclType- declared return typeargs- argument types- Returns:
- function type
-
get
Getter for function types without annotations.- Parameters:
declType- declared return typeargs- argument types- Returns:
- function type
-
find
Finds and returns the specified function type.- Parameters:
name- name of type- Returns:
- type or
null
-
similar
Returns an info message for a similar function.- Parameters:
qname- name of type- Returns:
- info string
-
get
Getter for a function's type.- Parameters:
anns- annotationsdeclType- declared return type (can benull)params- formal parameters- Returns:
- function type
-
atomic
Description copied from interface:TypeReturns the atomic type. -
id
Description copied from interface:TypeReturns a type id to differentiate all types. -
nsSensitive
public boolean nsSensitive()Description copied from interface:TypeChecks if the type is namespace-sensitive.- Specified by:
nsSensitivein interfaceType- Returns:
- result of check
-
toString
-