public enum AtomType extends Enum<AtomType> implements Type
Enum Constant and Description |
---|
AAT
Any atomic type.
|
AST
Any simple type.
|
ATM
Untyped Atomic type.
|
ATY
Any type.
|
B64
Base64 binary type.
|
BIN
Implementation specific: binary type.
|
BLN
Boolean type.
|
BYT
Byte type.
|
DAT
Date type.
|
DAY
Day type.
|
DBL
Double type.
|
DEC
Decimal type.
|
DTD
Day time duration type.
|
DTM
DateTime type.
|
DTS
DateTimeStamp type.
|
DUR
Duration type.
|
ENT
Entity type.
|
FLT
Float type.
|
HEX
Hex binary type.
|
ID
ID type.
|
IDR
IDREF type.
|
INT
Int type.
|
ITEM
Item type.
|
ITR
Integer type.
|
JAVA
Java type.
|
LAN
Language type.
|
LNG
Long type.
|
MDA
Month day type.
|
MON
Month type.
|
NAM
Name type.
|
NCN
NCName type.
|
NIN
Negative integer type.
|
NMT
NMTOKEN type.
|
NNI
Non-negative integer type.
|
NOT
NOTATION Type.
|
NPI
Non-positive integer type.
|
NST
Normalized String type.
|
NUM
Numeric type.
|
PDC
Precision decimal type.
|
PIN
Positive integer type.
|
QNM
QName Type.
|
SHR
Short type.
|
STR
String type.
|
TIM
Time type.
|
TOK
Token type.
|
UBY
Unsigned byte type.
|
UIN
Short type.
|
ULN
Unsigned long type.
|
URI
Any URI type.
|
USH
Unsigned Short type.
|
UTY
Untyped type.
|
YEA
Year type.
|
YMD
Year month duration type.
|
YMO
Year month type.
|
Modifier and Type | Field and Description |
---|---|
QNm |
name
Name.
|
AtomType |
parent
Parent type.
|
static AtomType[] |
VALUES
Cached enums (faster).
|
Modifier and Type | Method and Description |
---|---|
Item |
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 value,
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 AtomType |
find(QNm type,
boolean all)
Finds and returns the specified type.
|
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.
|
static AtomType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AtomType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AtomType ITEM
public static final AtomType UTY
public static final AtomType ATY
public static final AtomType AST
public static final AtomType AAT
public static final AtomType ATM
public static final AtomType STR
public static final AtomType NST
public static final AtomType TOK
public static final AtomType LAN
public static final AtomType NMT
public static final AtomType NAM
public static final AtomType NCN
public static final AtomType ID
public static final AtomType IDR
public static final AtomType ENT
public static final AtomType NUM
public static final AtomType FLT
public static final AtomType DBL
public static final AtomType DEC
public static final AtomType PDC
public static final AtomType ITR
public static final AtomType NPI
public static final AtomType NIN
public static final AtomType LNG
public static final AtomType INT
public static final AtomType SHR
public static final AtomType BYT
public static final AtomType NNI
public static final AtomType ULN
public static final AtomType UIN
public static final AtomType USH
public static final AtomType UBY
public static final AtomType PIN
public static final AtomType DUR
public static final AtomType YMD
public static final AtomType DTD
public static final AtomType DTM
public static final AtomType DTS
public static final AtomType DAT
public static final AtomType TIM
public static final AtomType YMO
public static final AtomType YEA
public static final AtomType MDA
public static final AtomType DAY
public static final AtomType MON
public static final AtomType BLN
public static final AtomType BIN
public static final AtomType B64
public static final AtomType HEX
public static final AtomType URI
public static final AtomType QNM
public static final AtomType NOT
public static final AtomType JAVA
public static final AtomType[] VALUES
public final QNm name
public final AtomType parent
public static AtomType[] values()
for (AtomType c : AtomType.values()) System.out.println(c);
public static AtomType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic 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 byte[] string()
Type
public Item 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 Item cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
Type
cast
in interface Type
value
- Java valueqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic final Item castString(String value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
Type
castString
in interface Type
value
- string objectqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic final SeqType seqType()
Type
public final boolean eq(Type t)
Type
public final boolean instanceOf(Type t)
Type
instanceOf
in interface Type
t
- type to be checkedpublic final Type union(Type t)
Type
public final Type intersect(Type t)
Type
null
is
returned.public final Type.ID id()
Type
public final String toString()
public final boolean nsSensitive()
Type
nsSensitive
in interface Type
Copyright © 2005–2015 BaseX Team. All rights reserved.