com.softwareag.tamino.db.api.response
Class TResponseQueryContentImpl

java.lang.Object
  extended by com.softwareag.tamino.db.api.response.TResponseQueryContentImpl
All Implemented Interfaces:
TResponseContent, TResponseQueryContent

public class TResponseQueryContentImpl
extends java.lang.Object
implements TResponseQueryContent

TResponseContentImpl is the implementation class for TResponseContent.

Version:
$Revision: 1.9 $
Author:
Marcus Schreyer

Constructor Summary
TResponseQueryContentImpl()
          Default Constructor.
TResponseQueryContentImpl(java.util.Enumeration enumeration)
          Constructor that takes an TXMLObject enumeration for initialization.
TResponseQueryContentImpl(java.util.Iterator iterator)
          Constructor that takes an TXMLObject iterator for initialization.
 
Method Summary
 void add(TXMLObject xmlObject)
          Adds the specified TXMLObject to the set.
 void addAll(java.util.Iterator iterator)
          Adds all TXMLObject instances underlying the iterator to the set.
 void clear()
          Clears the entire set.
 TXMLObject get(int index)
          Gets the TXMLObject at the specified index.
 java.lang.String getText()
          Gets text content that might be given for the response query content.
 boolean hasText()
          Indicates if text content is given for the response query content.
 java.util.Iterator iterator()
          Returns the iterator for this set.
 void reverse()
          Reverses the entire set of contained TXMLObjects.
 void set(int index, TXMLObject xmlObject)
          Sets the specified TXMLObject at the specified index.
 void setText(java.lang.String text)
          Sets text content that might be given for the responses query content.
 int size()
          Returns the size meaning number of TXMLObject instances currently stored within the sequence.
 void writeTo(java.io.Writer writer)
          Writes the current query content to the given Writer instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TResponseQueryContentImpl

public TResponseQueryContentImpl()
Default Constructor.


TResponseQueryContentImpl

public TResponseQueryContentImpl(java.util.Enumeration enumeration)
Constructor that takes an TXMLObject enumeration for initialization.


TResponseQueryContentImpl

public TResponseQueryContentImpl(java.util.Iterator iterator)
Constructor that takes an TXMLObject iterator for initialization.

Method Detail

add

public void add(TXMLObject xmlObject)
Adds the specified TXMLObject to the set.

Specified by:
add in interface TResponseQueryContent
Parameters:
xmlObject - that should be added to the set.

addAll

public void addAll(java.util.Iterator iterator)
Adds all TXMLObject instances underlying the iterator to the set.

Specified by:
addAll in interface TResponseQueryContent
Parameters:
iterator - is the iterator for TXMLObject instances.

set

public void set(int index,
                TXMLObject xmlObject)
         throws java.lang.IndexOutOfBoundsException
Sets the specified TXMLObject at the specified index.

Specified by:
set in interface TResponseQueryContent
Parameters:
index - should be in valid range.
xmlObject - is the object that should be inserted.
Throws:
java.lang.IndexOutOfBoundsException - when index is out of bounds.

setText

public void setText(java.lang.String text)
Sets text content that might be given for the responses query content. As an example for a _xql=count(xpath) the xql:result element only contains text content instead of serveral XML documents. This content can be set by this method.

Specified by:
setText in interface TResponseQueryContent
Parameters:
text - referrs to the text content that might be given for xql:result.

hasText

public boolean hasText()
Indicates if text content is given for the response query content. As an example for a _xql=count(xpath) the xql:result element only contains text content instead of several XML documents. This content can be accessed with this method.

Specified by:
hasText in interface TResponseQueryContent
Returns:
true if text content is given for the query content, false otherwise.

reverse

public void reverse()
Reverses the entire set of contained TXMLObjects.

Specified by:
reverse in interface TResponseQueryContent

iterator

public java.util.Iterator iterator()
Returns the iterator for this set. The iterator points to the start of the sequence.

Specified by:
iterator in interface TResponseQueryContent
Returns:
TResultSetIterator

get

public TXMLObject get(int index)
               throws java.lang.IndexOutOfBoundsException
Gets the TXMLObject at the specified index.

Specified by:
get in interface TResponseQueryContent
Returns:
TXMLObject at the specified index.
Throws:
java.lang.IndexOutOfBoundsException

getText

public java.lang.String getText()
Gets text content that might be given for the response query content. As an example for a _xql=count(xpath) the xql:result element only contains text content instead of several XML documents. This content can be accessed with this method.

Specified by:
getText in interface TResponseQueryContent
Returns:
the text content that might be given directly under the xql:result element, or if none is given the empty string.

clear

public void clear()
Clears the entire set. All TXMLObject instances already stored are removed.

Specified by:
clear in interface TResponseQueryContent

size

public int size()
Returns the size meaning number of TXMLObject instances currently stored within the sequence.

Specified by:
size in interface TResponseQueryContent

writeTo

public void writeTo(java.io.Writer writer)
Writes the current query content to the given Writer instance. Please note that for TXMLObject instances due to efficincy reasons only their root element with a given id and docname are written to the output stream. This operations mainly serves for debugging purpose.

Specified by:
writeTo in interface TResponseQueryContent
Parameters:
writer - is the output stream to which the sequnce of TXMLObject instances are written to.


Copyright (c) 2013 Software AG. All Rights Reserved.