de.fraunhofer.ipsi.ipsixq.api.impl
Class XQAbstractResultSequence

java.lang.Object
  extended by de.fraunhofer.ipsi.ipsixq.api.impl.XQAbstractResultSequence
All Implemented Interfaces:
XQItemAccessor, XQResultSequence, XQSequence
Direct Known Subclasses:
XQResultSequenceImpl

public abstract class XQAbstractResultSequence
extends java.lang.Object
implements XQResultSequence

Author:
Michael Stark

Constructor Summary
XQAbstractResultSequence()
           
 
Method Summary
 boolean absolute(int itempos)
          Moves the XQSequence's position to the given item number in this object.
 void afterLast()
          Move to the position after the last item.
 void beforeFirst()
          Moves to the position before the first item.
 void clearWarnings()
          Clears the list of warnings associated with this result sequence.
 void close()
          Closes the sequence and frees all resources associated with this sequence.
 boolean first()
          Moves to the first item in the sequence.
 XQItem getCachedItem()
          Get the current item as an immutable cached item object.
 java.util.Calendar getCalendar()
          Gets a calendar value.
 XQConnection getConnection()
          Gets the XQuery Connection associated with this result sequence.
 double getDouble()
          Gets a double value.
 int getInt()
          Gets an integer value.
 XQItem getItem()
          Get the current item as an immutable XQItem object.
 XQItemType getItemType()
          Gets the type of the the item.
 java.lang.String getLexicalValue()
          Gets the lexical string representation of the item.
 long getLong()
          Gets a long value.
 org.w3c.dom.Node getNode()
          Gets the item as a DOM node (if the current item is known to be a node).
 java.net.URI getNodeUri()
          Gets the URI associated with the content of this item.
 java.lang.Object getObject()
          Returns a generic java object corresponding to the XQuery type.
 java.lang.Object getObject(XQCommonHandler hdlr)
          Returns a java object corresponding to the XQuery type using the XQCommonhandler passed in.
 javax.xml.stream.XMLStreamReader getSequenceAsStream()
          Read the entire sequence starting from the current position as an XMLStreamReader object.
 java.lang.String getSequenceAsString()
          Converts the sequence into a string (of XML elements or document).
 java.lang.String getSequenceAsString(java.util.Properties props)
          Converts the sequence into a string (of XML elements or document).
 java.lang.String getString()
          Gets a string value.
 XQWarning getWarnings()
          Gets the first warning in the list of warnings associated with this result sequence.
 javax.xml.stream.XMLStreamReader getXMLStreamReader()
          Gets the current item as an XMLStreamReader object.
 boolean instanceOf(XQItemType type)
          Checks if the item is an instance of the given type (exact or subset of given type).
 boolean isAfterLast()
          Checks if the current position is after the last item in the sequence.
 boolean isBeforeFirst()
          Checks if the current position before the first item in the sequence.
 boolean isClosed()
          Checks if the sequence is closed.
 boolean isFirst()
          Checks if the current position at the first item in the sequence.
 boolean isLast()
          Checks if the current position at the last item in the sequence.
 boolean isOnItem()
          Check if the sequence is positioned on an item or not.
 boolean isScrollable()
          Checks if the sequence is scrollable.
 boolean last()
          Moves to the last item in the sequence.
 boolean next()
          Moves to the next item in the sequence.
 boolean previous()
          Moves to the previous item in the sequence
 boolean relative(int itempos)
          Moves the cursor a relative number of items, either positive or negative.
 void writeSAX(org.xml.sax.ContentHandler saxhdlr)
          Writes the current item to the SAX stream.
 void writeSequence(java.io.OutputStream os, java.util.Properties props)
          Writes the entire sequence starting from the current position to the output Writer.
 void writeSequence(java.io.Writer ow)
          Writes the entire sequence starting from the current position to the output Writer.
 void writeSequence(java.io.Writer ow, java.util.Properties props)
          Writes the entire sequence starting from the current position to the output Writer.
 void writeSequenceToSAX(org.xml.sax.ContentHandler saxhdlr)
          Writes the entire sequence starting from the current position to a SAX handler.
 void writeSequenceToStream(javax.xml.stream.XMLStreamWriter writer)
          Writes the entire sequence starting from the current position to an XMLStreamWriter object.
 void writeXMLStream(javax.xml.stream.XMLStreamWriter writer)
          Writes the current item to the XMLStreamWriter stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XQAbstractResultSequence

public XQAbstractResultSequence()
Method Detail

clearWarnings

public void clearWarnings()
Description copied from interface: XQResultSequence
Clears the list of warnings associated with this result sequence.

Specified by:
clearWarnings in interface XQResultSequence

getConnection

public XQConnection getConnection()
                           throws XQException
Description copied from interface: XQResultSequence
Gets the XQuery Connection associated with this result sequence.

Specified by:
getConnection in interface XQResultSequence
Throws:
XQException

getWarnings

public XQWarning getWarnings()
                      throws XQException
Description copied from interface: XQResultSequence
Gets the first warning in the list of warnings associated with this result sequence.

Specified by:
getWarnings in interface XQResultSequence
Throws:
XQException

absolute

public boolean absolute(int itempos)
                 throws XQException
Description copied from interface: XQSequence
Moves the XQSequence's position to the given item number in this object.

Specified by:
absolute in interface XQSequence
Throws:
XQException

afterLast

public void afterLast()
               throws XQException
Description copied from interface: XQSequence
Move to the position after the last item.

Specified by:
afterLast in interface XQSequence
Throws:
XQException

beforeFirst

public void beforeFirst()
                 throws XQException
Description copied from interface: XQSequence
Moves to the position before the first item.

Specified by:
beforeFirst in interface XQSequence
Throws:
XQException

close

public void close()
           throws XQException
Description copied from interface: XQSequence
Closes the sequence and frees all resources associated with this sequence.

Specified by:
close in interface XQSequence
Throws:
XQException

first

public boolean first()
              throws XQException
Description copied from interface: XQSequence
Moves to the first item in the sequence.

Specified by:
first in interface XQSequence
Throws:
XQException

getCachedItem

public XQItem getCachedItem()
                     throws XQException
Description copied from interface: XQSequence
Get the current item as an immutable cached item object.

Specified by:
getCachedItem in interface XQSequence
Throws:
XQException

getItem

public XQItem getItem()
               throws XQException
Description copied from interface: XQSequence
Get the current item as an immutable XQItem object.

Specified by:
getItem in interface XQSequence
Throws:
XQException

getSequenceAsStream

public javax.xml.stream.XMLStreamReader getSequenceAsStream()
                                                     throws XQException
Description copied from interface: XQSequence
Read the entire sequence starting from the current position as an XMLStreamReader object.

Specified by:
getSequenceAsStream in interface XQSequence
Throws:
XQException

getSequenceAsString

public java.lang.String getSequenceAsString()
                                     throws XQException
Description copied from interface: XQSequence
Converts the sequence into a string (of XML elements or document).

Specified by:
getSequenceAsString in interface XQSequence
Throws:
XQException

getSequenceAsString

public java.lang.String getSequenceAsString(java.util.Properties props)
                                     throws XQException
Description copied from interface: XQSequence
Converts the sequence into a string (of XML elements or document).

Specified by:
getSequenceAsString in interface XQSequence
Throws:
XQException

isAfterLast

public boolean isAfterLast()
                    throws XQException
Description copied from interface: XQSequence
Checks if the current position is after the last item in the sequence.

Specified by:
isAfterLast in interface XQSequence
Throws:
XQException

isBeforeFirst

public boolean isBeforeFirst()
                      throws XQException
Description copied from interface: XQSequence
Checks if the current position before the first item in the sequence.

Specified by:
isBeforeFirst in interface XQSequence
Throws:
XQException

isClosed

public boolean isClosed()
Description copied from interface: XQSequence
Checks if the sequence is closed.

Specified by:
isClosed in interface XQSequence

isFirst

public boolean isFirst()
                throws XQException
Description copied from interface: XQSequence
Checks if the current position at the first item in the sequence.

Specified by:
isFirst in interface XQSequence
Throws:
XQException

isLast

public boolean isLast()
               throws XQException
Description copied from interface: XQSequence
Checks if the current position at the last item in the sequence.

Specified by:
isLast in interface XQSequence
Throws:
XQException

isOnItem

public boolean isOnItem()
                 throws XQException
Description copied from interface: XQSequence
Check if the sequence is positioned on an item or not.

Specified by:
isOnItem in interface XQSequence
Throws:
XQException

isScrollable

public boolean isScrollable()
                     throws XQException
Description copied from interface: XQSequence
Checks if the sequence is scrollable.

Specified by:
isScrollable in interface XQSequence
Throws:
XQException

last

public boolean last()
             throws XQException
Description copied from interface: XQSequence
Moves to the last item in the sequence.

Specified by:
last in interface XQSequence
Throws:
XQException

next

public boolean next()
             throws XQException
Description copied from interface: XQSequence
Moves to the next item in the sequence.

Specified by:
next in interface XQSequence
Throws:
XQException

previous

public boolean previous()
                 throws XQException
Description copied from interface: XQSequence
Moves to the previous item in the sequence

Specified by:
previous in interface XQSequence
Throws:
XQException

relative

public boolean relative(int itempos)
                 throws XQException
Description copied from interface: XQSequence
Moves the cursor a relative number of items, either positive or negative.

Specified by:
relative in interface XQSequence
Throws:
XQException

writeSequence

public void writeSequence(java.io.OutputStream os,
                          java.util.Properties props)
                   throws XQException
Description copied from interface: XQSequence
Writes the entire sequence starting from the current position to the output Writer.

Specified by:
writeSequence in interface XQSequence
Throws:
XQException

writeSequence

public void writeSequence(java.io.Writer ow)
                   throws XQException
Description copied from interface: XQSequence
Writes the entire sequence starting from the current position to the output Writer.

Specified by:
writeSequence in interface XQSequence
Throws:
XQException

writeSequence

public void writeSequence(java.io.Writer ow,
                          java.util.Properties props)
                   throws XQException
Description copied from interface: XQSequence
Writes the entire sequence starting from the current position to the output Writer.

Specified by:
writeSequence in interface XQSequence
Throws:
XQException

writeSequenceToSAX

public void writeSequenceToSAX(org.xml.sax.ContentHandler saxhdlr)
                        throws XQException
Description copied from interface: XQSequence
Writes the entire sequence starting from the current position to a SAX handler.

Specified by:
writeSequenceToSAX in interface XQSequence
Throws:
XQException

writeSequenceToStream

public void writeSequenceToStream(javax.xml.stream.XMLStreamWriter writer)
                           throws XQException
Description copied from interface: XQSequence
Writes the entire sequence starting from the current position to an XMLStreamWriter object.

Specified by:
writeSequenceToStream in interface XQSequence
Throws:
XQException

getCalendar

public java.util.Calendar getCalendar()
                               throws XQException
Description copied from interface: XQItemAccessor
Gets a calendar value.

Specified by:
getCalendar in interface XQItemAccessor
Throws:
XQException

getDouble

public double getDouble()
                 throws XQException
Description copied from interface: XQItemAccessor
Gets a double value.

Specified by:
getDouble in interface XQItemAccessor
Throws:
XQException

getInt

public int getInt()
           throws XQException
Description copied from interface: XQItemAccessor
Gets an integer value.

Specified by:
getInt in interface XQItemAccessor
Throws:
XQException

getItemType

public XQItemType getItemType()
                       throws XQException
Description copied from interface: XQItemAccessor
Gets the type of the the item.

Specified by:
getItemType in interface XQItemAccessor
Throws:
XQException

getLexicalValue

public java.lang.String getLexicalValue()
                                 throws XQException
Description copied from interface: XQItemAccessor
Gets the lexical string representation of the item.

Specified by:
getLexicalValue in interface XQItemAccessor
Throws:
XQException

getLong

public long getLong()
             throws XQException
Description copied from interface: XQItemAccessor
Gets a long value.

Specified by:
getLong in interface XQItemAccessor
Throws:
XQException

getNode

public org.w3c.dom.Node getNode()
                         throws XQException
Description copied from interface: XQItemAccessor
Gets the item as a DOM node (if the current item is known to be a node).

Specified by:
getNode in interface XQItemAccessor
Throws:
XQException

getNodeUri

public java.net.URI getNodeUri()
                        throws XQException
Description copied from interface: XQItemAccessor
Gets the URI associated with the content of this item.

Specified by:
getNodeUri in interface XQItemAccessor
Throws:
XQException

getObject

public java.lang.Object getObject()
                           throws XQException
Description copied from interface: XQItemAccessor
Returns a generic java object corresponding to the XQuery type.

Specified by:
getObject in interface XQItemAccessor
Throws:
XQException

getObject

public java.lang.Object getObject(XQCommonHandler hdlr)
                           throws XQException
Description copied from interface: XQItemAccessor
Returns a java object corresponding to the XQuery type using the XQCommonhandler passed in.

Specified by:
getObject in interface XQItemAccessor
Throws:
XQException

getString

public java.lang.String getString()
                           throws XQException
Description copied from interface: XQItemAccessor
Gets a string value.

Specified by:
getString in interface XQItemAccessor
Throws:
XQException

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader()
                                                    throws XQException
Description copied from interface: XQItemAccessor
Gets the current item as an XMLStreamReader object.

Specified by:
getXMLStreamReader in interface XQItemAccessor
Throws:
XQException

instanceOf

public boolean instanceOf(XQItemType type)
                   throws XQException
Description copied from interface: XQItemAccessor
Checks if the item is an instance of the given type (exact or subset of given type).

Specified by:
instanceOf in interface XQItemAccessor
Throws:
XQException

writeSAX

public void writeSAX(org.xml.sax.ContentHandler saxhdlr)
              throws XQException
Description copied from interface: XQItemAccessor
Writes the current item to the SAX stream.

Specified by:
writeSAX in interface XQItemAccessor
Throws:
XQException

writeXMLStream

public void writeXMLStream(javax.xml.stream.XMLStreamWriter writer)
                    throws XQException
Description copied from interface: XQItemAccessor
Writes the current item to the XMLStreamWriter stream.

Specified by:
writeXMLStream in interface XQItemAccessor
Throws:
XQException