org.basex.query.value.item
Class Str

java.lang.Object
  extended by org.basex.data.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.value.Value
              extended by org.basex.query.value.item.Item
                  extended by org.basex.query.value.item.AStr
                      extended by org.basex.query.value.item.Str
All Implemented Interfaces:
java.lang.Iterable<Item>
Direct Known Subclasses:
Uri

public class Str
extends AStr

String item (xs:string, xs:normalizedString, xs:language, etc.).

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.expr.Expr
Expr.Flag
 
Field Summary
static Str ZERO
          Zero-length string.
 
Fields inherited from class org.basex.query.value.item.Item
score, UNDEF
 
Fields inherited from class org.basex.query.value.Value
type
 
Constructor Summary
Str(byte[] v, AtomType t)
          Constructor.
 
Method Summary
static Str get(byte[] v)
          Returns an instance of this class.
static Str get(java.lang.Object v, QueryContext ctx, InputInfo ii)
          Returns an instance of this class.
static Str get(java.lang.String s)
          Returns an instance of this class.
 boolean sameAs(Expr cmp)
          Compares the current and specified expression for equality.
 byte[] string()
          Returns the string value.
 byte[] string(InputInfo ii)
          Returns a string representation of the value.
 java.lang.String toJava()
          Returns a Java representation of the value.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.value.item.AStr
bool, diff, eq
 
Methods inherited from class org.basex.query.value.item.Item
castErr, comparable, dbl, dec, description, ebv, equiv, flt, hash, homogeneous, input, isItem, item, itemAt, iter, iterable, itr, materialize, plan, score, score, size, test, type, typeId, writeTo, xdmInfo
 
Methods inherited from class org.basex.query.value.Value
accept, cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, value
 
Methods inherited from class org.basex.query.expr.Expr
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, uses, visitAll
 
Methods inherited from class org.basex.data.ExprInfo
addPlan, addPlan, info, planAttr, planElem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Str ZERO
Zero-length string.

Constructor Detail

Str

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

Parameters:
v - value
t - data type
Method Detail

get

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

Parameters:
v - value
Returns:
instance

get

public static Str get(java.lang.String s)
Returns an instance of this class.

Parameters:
s - string
Returns:
instance

get

public static Str get(java.lang.Object v,
                      QueryContext ctx,
                      InputInfo ii)
               throws QueryException
Returns an instance of this class.

Parameters:
v - object (will be converted to token)
ctx - query context
ii - input info
Returns:
instance
Throws:
QueryException - query exception

string

public final byte[] string(InputInfo ii)
Description copied from class: Item
Returns a string representation of the value.

Specified by:
string in class Item
Parameters:
ii - input info, use null if none is available
Returns:
string value

string

public final byte[] string()
Returns the string value.

Returns:
string value

sameAs

public final boolean sameAs(Expr cmp)
Description copied from class: Expr
Compares the current and specified expression for equality.

Overrides:
sameAs in class Expr
Parameters:
cmp - expression to be compared
Returns:
result of check

toJava

public final java.lang.String toJava()
Description copied from class: Value
Returns a Java representation of the value.

Specified by:
toJava in class Value
Returns:
Java object

toString

public final java.lang.String toString()
Specified by:
toString in class ExprInfo