|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.value.type.SeqType
public final class SeqType
Stores a sequence type definition.
Nested Class Summary | |
---|---|
static class |
SeqType.Occ
Number of occurrences (cardinality). |
Field Summary | |
---|---|
static SeqType |
AAT
Zero or one xs:anyAtomicType. |
static SeqType |
AAT_ZM
Zero or more xs:anyAtomicType. |
static SeqType |
AAT_ZO
Zero or one xs:anyAtomicType. |
static MapType |
ANY_MAP
The general map type. |
static SeqType |
ATT
One attribute node. |
static SeqType |
B64
Single xs:base64Binary. |
static SeqType |
B64_ZM
Zero or more xs:base64Binary. |
static SeqType |
BIN
Single binary. |
static SeqType |
BIN_ZM
Zero or more binaries. |
static SeqType |
BLN
Single xs:boolean. |
static SeqType |
BLN_ZO
Zero or one xs:boolean. |
static SeqType |
BYT_OM
One or more bytes. |
static SeqType |
BYT_ZM
Zero or more bytes. |
static SeqType |
COM
One comment node. |
static SeqType |
DAT
Single date. |
static SeqType |
DAT_ZO
Zero or one date. |
static SeqType |
DBL
Double number. |
static SeqType |
DBL_ZM
Double number. |
static SeqType |
DBL_ZO
Zero or one double. |
static SeqType |
DEC_ZO
Zero or one decimal number. |
static SeqType |
DOC_O
One document node. |
static SeqType |
DOC_OM
One or more document node. |
static SeqType |
DOC_ZM
Zero or more document node. |
static SeqType |
DOC_ZO
Zero or one document node. |
static SeqType |
DTD
One day-time-duration. |
static SeqType |
DTD_ZO
Zero or one day-time-duration. |
static SeqType |
DTM
One date-time. |
static SeqType |
DTM_ZO
Zero or one date-time. |
static SeqType |
DUR_ZO
Zero or one duration. |
static SeqType |
ELM
One element node. |
static SeqType |
ELM_ZM
Zero or more element nodes. |
static SeqType |
EMP
Zero items. |
static SeqType |
FUN_O
Single function. |
static SeqType |
FUN_OZ
Zero of single function. |
static SeqType |
FUN_ZM
Zero of more functions. |
static SeqType |
HEX
One xs:hexBinary. |
static SeqType |
ITEM
Single item. |
static SeqType |
ITEM_OM
One or more items. |
static SeqType |
ITEM_ZM
Zero or more items. |
static SeqType |
ITEM_ZO
Zero or one item. |
static SeqType |
ITR
Single integer; for simplicity, numbers are summarized by this type. |
static SeqType |
ITR_OM
One or more integers. |
static SeqType |
ITR_ZM
Zero or more integers. |
static SeqType |
ITR_ZO
Zero or one integer. |
static SeqType |
MAP_O
Single function. |
static SeqType |
MAP_ZM
Single function. |
static SeqType |
NCN_ZO
Zero or one NCName. |
static SeqType |
NOD
Single node. |
static SeqType |
NOD_ZM
Zero or more nodes. |
static SeqType |
NOD_ZO
Zero or one nodes. |
static SeqType |
NSP
Namespace node. |
SeqType.Occ |
occ
Number of occurrences. |
static SeqType |
PI
Namespace node. |
static SeqType |
QNM
Single QName. |
static SeqType |
QNM_ZO
Zero or one QNames. |
static SeqType |
STR
Single string. |
static SeqType |
STR_ZM
Zero or more strings. |
static SeqType |
STR_ZO
Zero or one strings. |
static SeqType |
TIM
One time. |
static SeqType |
TIM_ZO
Zero or one time. |
static SeqType |
TXT_ZO
Namespace node. |
Type |
type
Sequence type. |
static SeqType |
URI
Single URI. |
static SeqType |
URI_ZM
Zero or more URIs. |
static SeqType |
URI_ZO
Zero or one URIs. |
Method Summary | |
---|---|
Value |
cast(Item it,
QueryContext ctx,
InputInfo ii,
ExprInfo e)
Tries to cast the given item to this sequence type. |
Value |
cast(Value val,
QueryContext ctx,
InputInfo ii,
ExprInfo e)
Casts a sequence to this type. |
boolean |
convertibleTo(SeqType t)
Checks if this type could be converted to the given one by function conversion. |
boolean |
eq(SeqType t)
Checks the types for equality. |
Value |
funcConvert(QueryContext ctx,
InputInfo ii,
Value val)
Performs function conversion on the given value. |
static SeqType |
get(Type t,
long o)
Returns a sequence type. |
static SeqType |
get(Type t,
SeqType.Occ o)
Returns a sequence type. |
static SeqType |
get(Type t,
SeqType.Occ o,
Test k)
Returns a sequence type. |
boolean |
instance(Value val)
Matches a value against this sequence type. |
boolean |
instanceOf(SeqType t)
Checks if the specified SeqType is an instance of the current SeqType. |
SeqType |
intersect(SeqType t)
Computes the intersection of two sequence types, i.e. |
boolean |
mayBeNumber()
Tests if the type may be numeric. |
boolean |
mayBeZero()
Tests if the type may yield zero items. |
long |
occ()
Returns the number of occurrences, or -1 if the number is unknown. |
boolean |
one()
Tests if the type exactly one item. |
java.lang.String |
toString()
|
Value |
treat(Value val,
InputInfo ii)
Treats the specified value as this sequence type. |
java.lang.String |
typeString()
Returns a string representation of the type. |
SeqType |
union(SeqType t)
Computes the union of two sequence types, i.e. |
SeqType |
withOcc(SeqType.Occ o)
Returns a version of this sequence type that is adapted to the given SeqType.Occ . |
boolean |
zeroOrOne()
Tests if the type yields at most one item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SeqType EMP
public static final SeqType ITEM
public static final SeqType ITEM_ZO
public static final SeqType ITEM_ZM
public static final SeqType ITEM_OM
public static final SeqType AAT
public static final SeqType AAT_ZO
public static final SeqType AAT_ZM
public static final SeqType BLN
public static final SeqType BLN_ZO
public static final SeqType DBL
public static final SeqType DBL_ZM
public static final SeqType DBL_ZO
public static final SeqType DEC_ZO
public static final SeqType ITR
public static final SeqType ITR_ZO
public static final SeqType ITR_ZM
public static final SeqType ITR_OM
public static final SeqType BYT_OM
public static final SeqType NOD
public static final SeqType NOD_ZO
public static final SeqType NOD_ZM
public static final SeqType QNM
public static final SeqType QNM_ZO
public static final SeqType URI
public static final SeqType URI_ZO
public static final SeqType URI_ZM
public static final SeqType STR
public static final SeqType STR_ZO
public static final SeqType STR_ZM
public static final SeqType NCN_ZO
public static final SeqType DAT
public static final SeqType DAT_ZO
public static final SeqType DTD
public static final SeqType DTD_ZO
public static final SeqType DTM
public static final SeqType DTM_ZO
public static final SeqType TIM
public static final SeqType TIM_ZO
public static final SeqType DUR_ZO
public static final SeqType FUN_OZ
public static final SeqType FUN_O
public static final SeqType FUN_ZM
public static final SeqType BYT_ZM
public static final SeqType ATT
public static final SeqType COM
public static final SeqType DOC_O
public static final SeqType DOC_ZO
public static final SeqType DOC_OM
public static final SeqType DOC_ZM
public static final SeqType ELM
public static final SeqType ELM_ZM
public static final SeqType NSP
public static final SeqType PI
public static final SeqType TXT_ZO
public static final MapType ANY_MAP
public static final SeqType MAP_ZM
public static final SeqType MAP_O
public static final SeqType HEX
public static final SeqType B64
public static final SeqType B64_ZM
public static final SeqType BIN
public static final SeqType BIN_ZM
public final Type type
public final SeqType.Occ occ
Method Detail |
---|
public static SeqType get(Type t, SeqType.Occ o)
t
- typeo
- occurrences
public static SeqType get(Type t, long o)
t
- typeo
- number of occurrences
public static SeqType get(Type t, SeqType.Occ o, Test k)
t
- typeo
- occurrencesk
- kind test
public SeqType withOcc(SeqType.Occ o)
SeqType.Occ
.
o
- occurrence indicator
public boolean instance(Value val)
val
- value to be checked
public Value cast(Item it, QueryContext ctx, InputInfo ii, ExprInfo e) throws QueryException
it
- item to castctx
- query contextii
- input infoe
- expression for error message
QueryException
- query exceptionpublic Value cast(Value val, QueryContext ctx, InputInfo ii, ExprInfo e) throws QueryException
val
- value to castctx
- query contextii
- input infoe
- expression
QueryException
- query exceptionpublic Value treat(Value val, InputInfo ii) throws QueryException
val
- value to promoteii
- input info
QueryException
- query exceptionpublic Value funcConvert(QueryContext ctx, InputInfo ii, Value val) throws QueryException
ctx
- query contextii
- input infoval
- value to convert
QueryException
- if the conversion ws not possiblepublic boolean convertibleTo(SeqType t)
t
- type to convert to
public SeqType union(SeqType t)
t
- second type
public SeqType intersect(SeqType t)
null
is returned
t
- second type
null
public long occ()
-1
if the number is unknown.
public boolean zeroOrOne()
public boolean one()
public boolean mayBeZero()
public boolean mayBeNumber()
public boolean eq(SeqType t)
t
- type
public boolean instanceOf(SeqType t)
t
- SeqType to check
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String typeString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |