public final class SeqType extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SeqType.Occ
Number of occurrences (cardinality).
|
Modifier and Type | Field and Description |
---|---|
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 ArrayType |
ANY_ARRAY
The general array type.
|
static MapType |
ANY_MAP
The general map type.
|
static SeqType |
ARRAY_O
Single array.
|
static SeqType |
ARRAY_ZM
Zero or more arrays.
|
static SeqType |
ATT
One attribute node.
|
static SeqType |
B64
Single xs:base64Binary.
|
static SeqType |
B64_ZM
Zero or more xs:base64Binary.
|
static SeqType |
B64_ZO
Zero or one xs:base64Binary.
|
static SeqType |
BIN
Single binary.
|
static SeqType |
BLN
Single xs:boolean.
|
static SeqType |
BLN_ZO
Zero or one xs:boolean.
|
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_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 |
FLT
Float number.
|
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 map.
|
static SeqType |
MAP_ZM
Zero or more maps.
|
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.
|
static SeqType |
NUM
Zero or one xs:numeric.
|
static SeqType |
NUM_ZO
Zero or one xs:numeric.
|
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
Item type.
|
static SeqType |
URI
Single URI.
|
static SeqType |
URI_ZM
Zero or more URIs.
|
static SeqType |
URI_ZO
Zero or one URIs.
|
Modifier and Type | Method and Description |
---|---|
Value |
cast(Item it,
QueryContext qc,
StaticContext sc,
InputInfo info,
boolean error)
Tries to cast the given item to this sequence type.
|
Value |
cast(Value val,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts a sequence to this type.
|
boolean |
eq(SeqType t)
Checks the types for equality.
|
static SeqType |
get(Type type,
long occ)
Returns a sequence type.
|
static SeqType |
get(Type type,
SeqType.Occ occ)
Returns a sequence type.
|
static SeqType |
get(Type type,
SeqType.Occ occ,
Test kind)
Returns a sequence type.
|
boolean |
instance(Item it,
boolean knd)
Checks if an item can be part of a sequence that is instance of this type.
|
boolean |
instance(Value val)
Matches a value against this sequence type.
|
boolean |
instanceOf(SeqType t)
Checks if this sequence type is an instance of the specified sequence type.
|
SeqType |
intersect(SeqType t)
Computes the intersection of two sequence types, i.e. the most general type that is
sub-type of both types.
|
boolean |
mayBeArray()
Tests if the type may be an array.
|
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.
|
boolean |
promotable(SeqType t)
Checks if this type could be converted to the given one by function conversion.
|
void |
promote(QueryContext qc,
StaticContext sc,
InputInfo ii,
Item item,
boolean opt,
ValueBuilder vb)
Promotes an item to the type of this sequence type.
|
Value |
promote(QueryContext qc,
StaticContext sc,
InputInfo ii,
Value value,
boolean opt)
Promotes a value to the type of this sequence type.
|
String |
toString() |
void |
treat(Value val,
InputInfo ii)
Checks the specified value for this sequence type.
|
String |
typeString()
Returns a string representation of the type.
|
SeqType |
union(SeqType t)
Computes the union of two sequence types, i.e. the lowest common ancestor of both
types.
|
SeqType |
withOcc(SeqType.Occ o)
Returns a version of this sequence type that is adapted to the given
SeqType.Occ . |
SeqType |
withSize(long 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.
|
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 NUM
public static final SeqType NUM_ZO
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 FLT
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 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_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 ArrayType ANY_ARRAY
public static final MapType ANY_MAP
public static final SeqType MAP_ZM
public static final SeqType MAP_O
public static final SeqType ARRAY_ZM
public static final SeqType ARRAY_O
public static final SeqType HEX
public static final SeqType B64
public static final SeqType B64_ZO
public static final SeqType B64_ZM
public static final SeqType BIN
public final Type type
public final SeqType.Occ occ
public static SeqType get(Type type, SeqType.Occ occ)
type
- typeocc
- occurrencespublic static SeqType get(Type type, long occ)
type
- typeocc
- number of occurrencespublic static SeqType get(Type type, SeqType.Occ occ, Test kind)
type
- typeocc
- occurrenceskind
- kind testpublic SeqType withOcc(SeqType.Occ o)
SeqType.Occ
.o
- occurrence indicatorpublic SeqType withSize(long o)
SeqType.Occ
.o
- occurrence indicatorpublic boolean instance(Value val)
val
- value to be checkedpublic boolean instance(Item it, boolean knd)
it
- item to checkknd
- check kindpublic Value cast(Item it, QueryContext qc, StaticContext sc, InputInfo info, boolean error) throws QueryException
it
- item to castqc
- query contextsc
- static contextinfo
- input infoerror
- return errorQueryException
- query exceptionpublic Value cast(Value val, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
val
- value to castqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic void treat(Value val, InputInfo ii) throws QueryException
val
- value to be checkedii
- input infoQueryException
- query exceptionpublic Value promote(QueryContext qc, StaticContext sc, InputInfo ii, Value value, boolean opt) throws QueryException
qc
- query contextsc
- static contextii
- input infovalue
- value to convertopt
- if the result should be optimizedQueryException
- if the conversion was not possiblepublic void promote(QueryContext qc, StaticContext sc, InputInfo ii, Item item, boolean opt, ValueBuilder vb) throws QueryException
qc
- query contextsc
- static contextii
- input infoitem
- item to promoteopt
- if the result should be optimizedvb
- value builderQueryException
- query exceptionpublic boolean promotable(SeqType t)
t
- type to convert topublic SeqType union(SeqType t)
t
- second typepublic SeqType intersect(SeqType t)
null
is returnedt
- second typenull
public long occ()
-1
if the number is unknown.public boolean zeroOrOne()
public boolean one()
public boolean mayBeZero()
public boolean mayBeNumber()
public boolean mayBeArray()
public boolean eq(SeqType t)
t
- typepublic boolean instanceOf(SeqType t)
t
- sequence type to checkpublic String typeString()
Copyright © 2005–2015 BaseX Team. All rights reserved.