Qizx/Open v0.4p2

net.xfra.qizxopen.xquery
Interface Item

All Known Subinterfaces:
Node, Value
All Known Implementing Classes:
net.xfra.qizxopen.xquery.dt.BaseValue, NodeBase

public interface Item

XQuery abstract Item value.

Specialized methods allow to retrieve or convert the actual value according to the type (return by getType()). A type exception is raised if the conversion is not possible.


Field Summary
static int INCOMPARABLE
           
 
Method Summary
 boolean asBoolean()
          Gets the item as a boolean value (optimisable).
 java.math.BigDecimal asDecimal()
          Gets the item as a decimal value.
 double asDouble()
          Gets the item as a double value (optimisable).
 float asFloat()
          Gets the item as a float value (optimisable).
 long asInteger()
          Gets the item as a integer value (optimisable).
 Node asNode()
          Gets the item as a Node value (optimisable).
 java.lang.String asString()
          Gets the item as a String value (optimisable).
 int compareTo(Item that, java.text.Collator collator, int implicitTimeZone)
          Compares two items.
 boolean deepEqual(Item item, java.text.Collator collator)
          Deep equality of two items.
 ItemType getType()
          Returns the type description.
 boolean isNode()
          Tests whether the item is a Node.
 

Field Detail

INCOMPARABLE

public static final int INCOMPARABLE
See Also:
Constant Field Values
Method Detail

getType

public ItemType getType()
Returns the type description.


asBoolean

public boolean asBoolean()
                  throws TypeException
Gets the item as a boolean value (optimisable).

TypeException

asFloat

public float asFloat()
              throws TypeException
Gets the item as a float value (optimisable).

TypeException

asDouble

public double asDouble()
                throws TypeException
Gets the item as a double value (optimisable).

TypeException

asInteger

public long asInteger()
               throws TypeException
Gets the item as a integer value (optimisable).

TypeException

asDecimal

public java.math.BigDecimal asDecimal()
                               throws TypeException
Gets the item as a decimal value.

TypeException

asString

public java.lang.String asString()
                          throws TypeException
Gets the item as a String value (optimisable).

TypeException

asNode

public Node asNode()
            throws TypeException
Gets the item as a Node value (optimisable).

TypeException

isNode

public boolean isNode()
Tests whether the item is a Node.


compareTo

public int compareTo(Item that,
                     java.text.Collator collator,
                     int implicitTimeZone)
              throws TypeException
Compares two items. if items are equal, returns 0, if no order is defined, or items are of different nature, returns INCOMPARABLE, if this < that return -1, if this > that return 1.

TypeException

deepEqual

public boolean deepEqual(Item item,
                         java.text.Collator collator)
Deep equality of two items.


 Copyright Xavier FRANC 2003-2004