com.softwareag.tamino.db.api.response.logging
Class TXMLObjectIteratorTimeLoggingImpl

java.lang.Object
  extended by com.softwareag.tamino.db.api.response.TXMLObjectIteratorImpl
      extended by com.softwareag.tamino.db.api.response.logging.TXMLObjectIteratorTimeLoggingImpl
All Implemented Interfaces:
TXMLObjectIterator

public class TXMLObjectIteratorTimeLoggingImpl
extends TXMLObjectIteratorImpl

TXMLObjectIteratorTimeLoggingImpl is an extension of TXMLObjectIteratorImpl that support time logging for the methods of the TXMLObjectIterator interface.

Version:
$Revision: 1.3 $
Author:
Oliver.Kleber@softwareag.com

Field Summary
 
Fields inherited from class com.softwareag.tamino.db.api.response.TXMLObjectIteratorImpl
START_AT_BEGIN, START_AT_END
 
Constructor Summary
TXMLObjectIteratorTimeLoggingImpl()
          Initializes the default (empty) TXMLObjectIteratorTimeLoggingImpl.
TXMLObjectIteratorTimeLoggingImpl(TResponseQueryContent responseQueryContent)
          Initializes the TXMLObjectIteratorTimeLoggingImpl with the given TResponseQueryContent.
 
Method Summary
 boolean canMoveBy(int offset)
          Indicates if this iterator can be moved by the given offset.
 void close()
          Invalidate this iterator.
 int getCount()
          Gets the query count as an int.
 boolean hasCount()
          Indicates if the response of Tamino contained the query count.
 boolean hasNext()
          Indicates if iterator has a next TXMLObject instance.
 boolean hasPrevious()
          Indicates if this iterator has a previous TXMLObject instance.
 void moveBy(int offset)
          Moves the iterator by the given offset.
 TXMLObject next()
          Returns the next TXMLObject in the underlying sequence.
 TXMLObject previous()
          Returns the previous TXMLObject in the list.
 void reset()
          Resets the iterator to its initial state as it has been constructed.
 
Methods inherited from class com.softwareag.tamino.db.api.response.TXMLObjectIteratorImpl
getCurrentIndex, getLocale, getResponseQueryContent, initIndex, setCurrentIndex, setLocale, setResponseQueryContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TXMLObjectIteratorTimeLoggingImpl

public TXMLObjectIteratorTimeLoggingImpl()
Initializes the default (empty) TXMLObjectIteratorTimeLoggingImpl.


TXMLObjectIteratorTimeLoggingImpl

public TXMLObjectIteratorTimeLoggingImpl(TResponseQueryContent responseQueryContent)
Initializes the TXMLObjectIteratorTimeLoggingImpl with the given TResponseQueryContent.

Parameters:
responseQueryContent - denotes the query content over which can be iterated.
Method Detail

hasNext

public boolean hasNext()
Indicates if iterator has a next TXMLObject instance.

Specified by:
hasNext in interface TXMLObjectIterator
Overrides:
hasNext in class TXMLObjectIteratorImpl
Returns:
true if next element is given, false otherwise.

next

public TXMLObject next()
                throws TNoSuchXMLObjectException,
                       TIteratorException
Returns the next TXMLObject in the underlying sequence. This method may be called repeatedly to iterate through the list, or intermixed with calls to previous to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Specified by:
next in interface TXMLObjectIterator
Overrides:
next in class TXMLObjectIteratorImpl
Returns:
The next XmlObject.
Throws:
java.util.NoSuchElementException - if iteration has no more elements.
TIteratorException - if iteration failed because of an underlying Tamino problem.
TNoSuchXMLObjectException - the if iteration has no next TXMLObject instance.

hasPrevious

public boolean hasPrevious()
Indicates if this iterator has a previous TXMLObject instance.

Specified by:
hasPrevious in interface TXMLObjectIterator
Overrides:
hasPrevious in class TXMLObjectIteratorImpl
Returns:
true if previous TXMLObject is given, false otherwise.

previous

public TXMLObject previous()
                    throws TNoSuchXMLObjectException,
                           TIteratorException
Returns the previous TXMLObject in the list. This method may be called repeatedly to iterate backwards through the list of given TXMLObject instances.

Specified by:
previous in interface TXMLObjectIterator
Overrides:
previous in class TXMLObjectIteratorImpl
Returns:
The previous TXMLObject.
Throws:
java.util.NoSuchElementException - if iteration has no more elements.
TIteratorException - if iteration failed because of an underlying Tamino problem.
TNoSuchXMLObjectException - if the iteration has no previous TXMLObject instance.

hasCount

public boolean hasCount()
Indicates if the response of Tamino contained the query count.

Specified by:
hasCount in interface TXMLObjectIterator
Overrides:
hasCount in class TXMLObjectIteratorImpl
Returns:
true if the response of Tamino contained the query count, false otherwise.

getCount

public int getCount()
Gets the query count as an int. The query count is the total number of resulting objects for a query issued against Tamino. The query count is only available for queries that have been issued using the query method specifying a quantity (i.e. when the Tamino cursoring mechanism is being used). Tamino only returns a query count in case its calculation does not require the creation of the result set as a whole. In other words, Tamino only returns a query count if it is not expensive to calculate.

Specified by:
getCount in interface TXMLObjectIterator
Overrides:
getCount in class TXMLObjectIteratorImpl
Returns:
the query count as an int, if available. Otherwise, -1 is returned.

canMoveBy

public boolean canMoveBy(int offset)
                  throws TIteratorException
Indicates if this iterator can be moved by the given offset.

Specified by:
canMoveBy in interface TXMLObjectIterator
Overrides:
canMoveBy in class TXMLObjectIteratorImpl
Parameters:
offset - the positive or negative amount to move the iterator
Returns:
true if move is possible, false otherwise.
Throws:
TIteratorException - if iteration failed because of an underlying Tamino problem.

moveBy

public void moveBy(int offset)
            throws TNoSuchXMLObjectException,
                   TIteratorException
Moves the iterator by the given offset.

Specified by:
moveBy in interface TXMLObjectIterator
Overrides:
moveBy in class TXMLObjectIteratorImpl
Parameters:
offset - the positive or negative amount to move the iterator
Throws:
TNoSuchXMLObjectException - if the new position is out of bounds.
TIteratorException - if iteration failed because of an underlying Tamino problem.

reset

public void reset()
           throws TIteratorException
Resets the iterator to its initial state as it has been constructed.

Specified by:
reset in interface TXMLObjectIterator
Overrides:
reset in class TXMLObjectIteratorImpl
Throws:
TIteratorException - if iteration failed because of an underlying Tamino problem.

close

public void close()
           throws TIteratorException
Invalidate this iterator. Closing the iterator releases any resources which a iterator may hold. After closing a iterator it is no longer usable.

Specified by:
close in interface TXMLObjectIterator
Overrides:
close in class TXMLObjectIteratorImpl
Throws:
TIteratorException - if iteration failed because of an underlying Tamino problem.


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