Modifier and Type | Field and Description |
---|---|
AnnList |
anns
Annotations.
|
static FuncType |
ANY_FUN
Any function type.
|
SeqType[] |
argTypes
Argument types.
|
SeqType |
retType
Return type.
|
Modifier and Type | Method and Description |
---|---|
static FuncType |
arity(int a)
Getter for function types with a given arity.
|
FItem |
cast(Item item,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts the specified item to this item type.
|
Item |
cast(Object value,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts the specified Java value to this item type.
|
Item |
castString(String string,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts the specified string to this item type.
|
boolean |
eq(Type t)
Checks if this type is equal to the given one.
|
static Type |
find(QNm type)
Finds and returns the specified function type.
|
static FuncType |
get(AnnList anns,
SeqType ret,
SeqType... args)
Getter for function types.
|
static FuncType |
get(AnnList anns,
Var[] args,
SeqType ret)
Getter for a function's type.
|
static FuncType |
get(SeqType ret,
SeqType... args)
Getter for function types without annotations.
|
Type.ID |
id()
Returns a type id to differentiate all types.
|
boolean |
instanceOf(Type t)
Checks if the current type is an instance of the specified type.
|
Type |
intersect(Type t)
Computes the intersection between this type and the given one, i.e. the least
specific type that is sub-type of both types.
|
boolean |
isNumber()
Checks if the type refers to a number.
|
boolean |
isNumberOrUntyped()
Checks if the type refers to a number or an untyped item.
|
boolean |
isStringOrUntyped()
Checks if the type refers to a number or a string.
|
boolean |
isUntyped()
Checks if the type refers to an untyped item.
|
boolean |
nsSensitive()
Checks if the type is namespace-sensitive.
|
SeqType |
seqType()
Returns a sequence type with this item type.
|
byte[] |
string()
Returns the string representation of this type.
|
String |
toString() |
Type |
union(Type t)
Computes the union between this type and the given one, i.e. the least common
ancestor of both types in the type hierarchy.
|
public static final FuncType ANY_FUN
public final AnnList anns
public final SeqType[] argTypes
public final SeqType retType
public final boolean isNumber()
Type
public final boolean isUntyped()
Type
public final boolean isNumberOrUntyped()
Type
isNumberOrUntyped
in interface Type
public final boolean isStringOrUntyped()
Type
isStringOrUntyped
in interface Type
public final SeqType seqType()
Type
public byte[] string()
Type
public FItem cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
Type
cast
in interface Type
item
- item to be convertedqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic final Item cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii)
Type
public final Item castString(String string, QueryContext qc, StaticContext sc, InputInfo ii)
Type
castString
in interface Type
string
- string objectqc
- query contextsc
- static contextii
- input infopublic boolean eq(Type t)
Type
public boolean instanceOf(Type t)
Type
instanceOf
in interface Type
t
- type to be checkedpublic Type union(Type t)
Type
public Type intersect(Type t)
Type
null
is
returned.public static FuncType get(AnnList anns, SeqType ret, SeqType... args)
anns
- annotationsret
- return typeargs
- argument typespublic static FuncType get(SeqType ret, SeqType... args)
ret
- return typeargs
- argument typespublic static Type find(QNm type)
type
- typenull
public static FuncType arity(int a)
a
- number of argumentspublic static FuncType get(AnnList anns, Var[] args, SeqType ret)
anns
- annotationsargs
- formal parametersret
- return typepublic final Type.ID id()
Type
public String toString()
public boolean nsSensitive()
Type
nsSensitive
in interface Type
Copyright © 2005–2015 BaseX Team. All rights reserved.