public class TXMLObjectIteratorImpl extends java.lang.Object implements TXMLObjectIterator
Modifier and Type | Field and Description |
---|---|
protected static int |
START_AT_BEGIN
An indicator for the iteration start at the beginning of a sequence.
|
protected static int |
START_AT_END
An indicator for the iteration start at the ending of a sequence.
|
Constructor and Description |
---|
TXMLObjectIteratorImpl()
Initializes the default (empty) TXMLObjectIteratorImpl.
|
TXMLObjectIteratorImpl(TResponseQueryContent responseQueryContent)
Initializes the TXMLObjectIteratorImpl with the given TResponseQueryContent.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected int |
getCurrentIndex()
Return the current index.
|
java.util.Locale |
getLocale()
Gets the locale.
|
protected TResponseQueryContent |
getResponseQueryContent()
Gets the current response query content.
|
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.
|
protected void |
initIndex(int startAt)
Internal method for initializing the index.
|
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.
|
protected void |
setCurrentIndex(int newIndex)
Set the current index.
|
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
protected void |
setResponseQueryContent(java.util.Iterator iterator,
int proceedIteration)
Sets a new response query content on the iterator and moves the iterator to either the beginning
or ending of the content sequence.
|
protected static final int START_AT_BEGIN
protected static final int START_AT_END
public TXMLObjectIteratorImpl()
public TXMLObjectIteratorImpl(TResponseQueryContent responseQueryContent)
responseQueryContent
- denotes the query content over which can be iterated.public boolean hasNext()
hasNext
in interface TXMLObjectIterator
public TXMLObject next() throws TNoSuchXMLObjectException, TIteratorException
next
in interface TXMLObjectIterator
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.public boolean hasPrevious()
hasPrevious
in interface TXMLObjectIterator
public TXMLObject previous() throws TNoSuchXMLObjectException, TIteratorException
previous
in interface TXMLObjectIterator
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.public boolean hasCount()
hasCount
in interface TXMLObjectIterator
public int getCount()
getCount
in interface TXMLObjectIterator
public boolean canMoveBy(int offset) throws TIteratorException
canMoveBy
in interface TXMLObjectIterator
offset
- the positive or negative amount to move the iteratorTIteratorException
- if iteration failed because of an underlying Tamino problem.public void moveBy(int offset) throws TNoSuchXMLObjectException, TIteratorException
moveBy
in interface TXMLObjectIterator
offset
- the positive or negative amount to move the iteratorTNoSuchXMLObjectException
- if the new position is out of bounds.TIteratorException
- if iteration failed because of an underlying Tamino problem.public void reset() throws TIteratorException
reset
in interface TXMLObjectIterator
TIteratorException
- if iteration failed because of an underlying Tamino problem.protected final int getCurrentIndex()
protected final void setCurrentIndex(int newIndex)
public void close() throws TIteratorException
close
in interface TXMLObjectIterator
TIteratorException
- if iteration failed because of an underlying Tamino problem.protected void setResponseQueryContent(java.util.Iterator iterator, int proceedIteration)
iterator
- points to underyling TXMLObject instances.proceedIteration
- indicates where the iterator should proceed with iterations, either START_AT_BEGIN
or START_AT_END can be used here. The latter only makes sense once this iterator is capable for
backward iterations.public void setLocale(java.util.Locale locale)
public java.util.Locale getLocale()
protected TResponseQueryContent getResponseQueryContent()
protected void initIndex(int startAt)
Copyright (c) 2017 Software AG. All Rights Reserved.