org.basex.query.xquery.item
Class Str

java.lang.Object
  extended by org.basex.query.xquery.expr.Expr
      extended by org.basex.query.xquery.item.Item
          extended by org.basex.query.xquery.item.Str
Direct Known Subclasses:
Atm, Lan, Nam, NCN, NMT, NSt, Tok, URI

public class Str
extends Item

String item.

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

Field Summary
static Str ZERO
          String data.
 
Fields inherited from class org.basex.query.xquery.expr.Expr
type
 
Constructor Summary
Str(byte[] v, Type t)
          Constructor.
 
Method Summary
 boolean bool()
          Returns a boolean representation of the item.
 double dbl()
          Returns a double representation of the item.
 int diff(Item it)
          Returns the difference between the current and the specified item.
 boolean eq(Item it)
          Checks the items for equality.
 float flt()
          Returns a float representation of the item.
static Str get(byte[] v)
          Returns an instance of this class.
 long itr()
          Returns a numeric (long) representation of the item.
 boolean s()
          Checks if this is a string item.
static void serialize(PrintOutput out, byte[] val)
          Serializes the specified text.
 void serialize(PrintOutput out, XQContext ctx, int level)
          Serializes the item.
 byte[] str()
          Returns an atomized string.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xquery.item.Item
castErr, comp, eval, i, info, iter, serialize, size
 
Methods inherited from class org.basex.query.xquery.expr.Expr
cls, d, e, n, node, u
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Str ZERO
String data.

Constructor Detail

Str

public Str(byte[] v,
           Type t)
Constructor.

Parameters:
v - value
t - data type
Method Detail

bool

public boolean bool()
Description copied from class: Item
Returns a boolean representation of the item.

Overrides:
bool in class Item
Returns:
boolean value

dbl

public double dbl()
           throws XQException
Description copied from class: Item
Returns a double representation of the item.

Overrides:
dbl in class Item
Returns:
double value
Throws:
XQException - evaluation exception

diff

public int diff(Item it)
         throws XQException
Description copied from class: Item
Returns the difference between the current and the specified item.

Overrides:
diff in class Item
Parameters:
it - item to be compared.
Returns:
difference
Throws:
XQException - evaluation exception

eq

public boolean eq(Item it)
           throws XQException
Description copied from class: Item
Checks the items for equality.

Specified by:
eq in class Item
Parameters:
it - item to be compared.
Returns:
result of check
Throws:
XQException - evaluation exception

flt

public final float flt()
                throws XQException
Description copied from class: Item
Returns a float representation of the item.

Overrides:
flt in class Item
Returns:
float value
Throws:
XQException - evaluation exception

get

public static Str get(byte[] v)
Returns an instance of this class.

Parameters:
v - value
Returns:
instance

itr

public long itr()
         throws XQException
Description copied from class: Item
Returns a numeric (long) representation of the item.

Overrides:
itr in class Item
Returns:
long value
Throws:
XQException - evaluation exception

s

public boolean s()
Description copied from class: Expr
Checks if this is a string item.

Overrides:
s in class Expr
Returns:
result of check

serialize

public static void serialize(PrintOutput out,
                             byte[] val)
                      throws java.io.IOException
Serializes the specified text.

Parameters:
out - output stream
val - text to be serialized
Throws:
java.io.IOException - I/O exception

serialize

public final void serialize(PrintOutput out,
                            XQContext ctx,
                            int level)
                     throws java.io.IOException
Description copied from class: Item
Serializes the item.

Overrides:
serialize in class Item
Parameters:
out - output stream
ctx - query context
level - current level
Throws:
java.io.IOException - I/O exception

str

public final byte[] str()
Description copied from class: Expr
Returns an atomized string.

Overrides:
str in class Expr
Returns:
string representation

toString

public java.lang.String toString()
Overrides:
toString in class Item