org.basex.query.item
Class SeqType

java.lang.Object
  extended by org.basex.query.item.SeqType

public final class SeqType
extends Object

Stores a sequence type definition.

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

Field Summary
 QNm ext
          Extended type info.
 int occ
          Occurrence mode: 0 = default, 1 = "?"
 Type type
          Sequence type.
 
Constructor Summary
SeqType(QNm name, int o, boolean e)
          Constructor.
 
Method Summary
 Item cast(Item it, Expr expr, QueryContext ctx)
          Casts the specified item.
 Item cast(Item item, QueryContext ctx)
          Casts the specified item.
 boolean instance(Iter iter)
          Checks the instance of the specified iterator.
 Return returned()
          Indicates the return type of an expression.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ext

public QNm ext
Extended type info.


type

public Type type
Sequence type.


occ

public int occ
Occurrence mode: 0 = default, 1 = "?", 2 = "+", 3 = "*".

Constructor Detail

SeqType

public SeqType(QNm name,
               int o,
               boolean e)
Constructor.

Parameters:
name - sequence type
o - occurrences
e - extended info
Method Detail

instance

public boolean instance(Iter iter)
                 throws QueryException
Checks the instance of the specified iterator.

Parameters:
iter - iteration to be checked
Returns:
result of check
Throws:
QueryException - query exception

cast

public Item cast(Item it,
                 Expr expr,
                 QueryContext ctx)
          throws QueryException
Casts the specified item.

Parameters:
it - item
expr - expression reference
ctx - query context
Returns:
resulting item
Throws:
QueryException - query exception

cast

public Item cast(Item item,
                 QueryContext ctx)
          throws QueryException
Casts the specified item.

Parameters:
item - item to be cast
ctx - query context
Returns:
resulting item
Throws:
QueryException - query exception

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

toString

public String toString()
Overrides:
toString in class Object