org.basex.query.item
Enum Type

java.lang.Object
  extended by java.lang.Enum<Type>
      extended by org.basex.query.item.Type
All Implemented Interfaces:
Serializable, Comparable<Type>

public enum Type
extends Enum<Type>

XQuery data types.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Enum Constant Summary
AAT
          Any atomic type.
ATM
          Untyped Atomic type.
ATT
          Attribute type.
B6B
          Base64 binary type.
BLN
          Boolean type.
BYT
          Byte type.
COM
          Comment type.
DAT
          Date type.
DAY
          Day type.
DBL
          Double type.
DEC
          Decimal type.
DEL
          Document element type (required by XQJ API).
DOC
          Document type.
DTD
          Day time duration type.
DTM
          DateTime type.
DUR
          Duration type.
ELM
          Element type.
EMP
          Empty sequence 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.
NOD
          Node type.
NOT
          NOTATION Type.
NPI
          Non-positive integer type.
NST
          Normalized String type.
PI
          PI type.
PIN
          Positive integer type.
QNM
          QName Type.
SEQ
          Sequence type.
SHR
          Short type.
STR
          String type.
TIM
          Time type.
TOK
          Token type.
TXT
          Text type.
UBY
          Unsigned byte type.
UIN
          Short type.
ULN
          Unsigned long type.
URI
          Any URI type.
USH
          Unsigned Short type.
YEA
          Year type.
YMD
          Year month duration type.
YMO
          Year month type.
 
Field Summary
 boolean dur
          Duration flag.
 String name
          String representation.
 boolean num
          Number flag.
 Type par
          Parent type.
 boolean str
          String flag.
 boolean unt
          Untyped flag.
 byte[] uri
          URI representation.
 
Method Summary
 Item e(Item it, QueryContext ctx)
          Constructs a new item from the specified item.
 Item e(Object o)
          Constructs a new item from the specified Java object.
static Type find(QNm type, boolean nodes)
          Finds and returns the specified data type.
 boolean instance(Type t)
          Checks if the specified type is an instance of the current type.
 boolean node()
          Checks if the type refers to a node.
static Type node(QNm type)
          Finds and returns the specified node type.
 Return returned()
          Indicates the return type of an expression.
 String toString()
           
static Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ITEM

public static final Type ITEM
Item type.


AAT

public static final Type AAT
Any atomic type.


ATM

public static final Type ATM
Untyped Atomic type.


STR

public static final Type STR
String type.


NST

public static final Type NST
Normalized String type.


TOK

public static final Type TOK
Token type.


LAN

public static final Type LAN
Language type.


NMT

public static final Type NMT
NMTOKEN type.


NAM

public static final Type NAM
Name type.


NCN

public static final Type NCN
NCName type.


ID

public static final Type ID
ID type.


IDR

public static final Type IDR
IDREF type.


ENT

public static final Type ENT
Entity type.


FLT

public static final Type FLT
Float type.


DBL

public static final Type DBL
Double type.


DEC

public static final Type DEC
Decimal type.


ITR

public static final Type ITR
Integer type.


NPI

public static final Type NPI
Non-positive integer type.


NIN

public static final Type NIN
Negative integer type.


LNG

public static final Type LNG
Long type.


INT

public static final Type INT
Int type.


SHR

public static final Type SHR
Short type.


BYT

public static final Type BYT
Byte type.


NNI

public static final Type NNI
Non-negative integer type.


ULN

public static final Type ULN
Unsigned long type.


UIN

public static final Type UIN
Short type.


USH

public static final Type USH
Unsigned Short type.


UBY

public static final Type UBY
Unsigned byte type.


PIN

public static final Type PIN
Positive integer type.


DUR

public static final Type DUR
Duration type.


YMD

public static final Type YMD
Year month duration type.


DTD

public static final Type DTD
Day time duration type.


DTM

public static final Type DTM
DateTime type.


DAT

public static final Type DAT
Date type.


TIM

public static final Type TIM
Time type.


YMO

public static final Type YMO
Year month type.


YEA

public static final Type YEA
Year type.


MDA

public static final Type MDA
Month day type.


DAY

public static final Type DAY
Day type.


MON

public static final Type MON
Month type.


BLN

public static final Type BLN
Boolean type.


B6B

public static final Type B6B
Base64 binary type.


HEX

public static final Type HEX
Hex binary type.


URI

public static final Type URI
Any URI type.


QNM

public static final Type QNM
QName Type.


NOT

public static final Type NOT
NOTATION Type.


NOD

public static final Type NOD
Node type.


TXT

public static final Type TXT
Text type.


PI

public static final Type PI
PI type.


ELM

public static final Type ELM
Element type.


DOC

public static final Type DOC
Document type.


DEL

public static final Type DEL
Document element type (required by XQJ API).


ATT

public static final Type ATT
Attribute type.


COM

public static final Type COM
Comment type.


SEQ

public static final Type SEQ
Sequence type.


EMP

public static final Type EMP
Empty sequence type.


JAVA

public static final Type JAVA
Java type.

Field Detail

name

public final String name
String representation.


uri

public final byte[] uri
URI representation.


num

public final boolean num
Number flag.


par

public final Type par
Parent type.


unt

public final boolean unt
Untyped flag.


str

public final boolean str
String flag.


dur

public final boolean dur
Duration flag.

Method Detail

values

public static Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Type c : Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

e

public Item e(Item it,
              QueryContext ctx)
       throws QueryException
Constructs a new item from the specified item.

Parameters:
it - item to be converted
ctx - query context
Returns:
new item
Throws:
QueryException - query exception

e

public Item e(Object o)
       throws QueryException
Constructs a new item from the specified Java object. The Java object is supposed to have a correct mapping type.

Parameters:
o - Java object
Returns:
new item
Throws:
QueryException - query exception

instance

public boolean instance(Type t)
Checks if the specified type is an instance of the current type.

Parameters:
t - type to be checked
Returns:
result of check

node

public boolean node()
Checks if the type refers to a node.

Returns:
result of check

returned

public Return returned()
Indicates the return type of an expression. Called by the compiler to check if expressions can be reformulated. null is returned by default.

Returns:
result of check

find

public static Type find(QNm type,
                        boolean nodes)
Finds and returns the specified data type.

Parameters:
type - type as string
nodes - flag for including node types
Returns:
type or null

node

public static Type node(QNm type)
Finds and returns the specified node type.

Parameters:
type - type as string
Returns:
type or null

toString

public String toString()
Overrides:
toString in class Enum<Type>