| java.lang.Object com.hp.hpl.jena.util.iterator.ConcatenatedIterator
ConcatenatedIterator | public class ConcatenatedIterator implements Iterator(Code) | | An iterator that represents the concatenation of two individual iterators.
The concatenated iterator will range over the elements of the first iterator,
followed by the elements of the second.
author: Ian Dickinson, HP Labs (email) version: CVS info: $Id: ConcatenatedIterator.java,v 1.13 2008/01/02 12:07:35 andy_seaborne Exp $ |
Method Summary | |
public boolean | hasDefaultValue() Answer true if this iteration has a default value. | public boolean | hasNext() Returns true if the iteration has more elements. | public Object | next() Returns the next element in the interation. | public void | remove() Removes from the underlying collection the last element returned by
the iterator (optional operation). | public void | setDefaultValue(Object defaultValue) Set the default value for this iteration, which will be a value that
is guaranteed to be returned as a member of the iteration. |
m_defaultValue | protected Object m_defaultValue(Code) | | The default value for the iterator, or null if no default
|
m_defaultValueSeen | protected boolean m_defaultValueSeen(Code) | | A flag to show that the default value has been returned
|
ConcatenatedIterator | public ConcatenatedIterator(Iterator iter0, Iterator iter1)(Code) | | Construct an iterator that is the concatenation of the two
given iterators. Either iterator may be a Java iterator, or a Jena
node or resource iterator.
Parameters: iter0 - The first iterator. Elements of this iterator will appearfirst in the elements read from the concatenation. Parameters: iter1 - The second iterator. Elements of this iterator will appearsecond in the elements read from the concatenation. |
hasDefaultValue | public boolean hasDefaultValue()(Code) | | Answer true if this iteration has a default value.
true if there is a default value |
hasNext | public boolean hasNext()(Code) | | Returns true if the iteration has more elements. This will be
true if either of the underlying iterators has more elements.
true if the iterator has more elements. |
next | public Object next()(Code) | | Returns the next element in the interation.
The next object in the iteration, which will correspond to the next object in theunderlying iteration, projected to the range of the projection function. exception: NoSuchElementException - - iteration has no more elements. |
remove | public void remove()(Code) | | Removes from the underlying collection the last element returned by
the iterator (optional operation). Not supported on a concatenated
iterator.
exception: UnsupportedOperationException - - if the remove operation is notsupported by this Iterator. exception: IllegalStateException - - if the next method has not yet beencalled, or the remove method has already been called after thelast call to the next method. |
setDefaultValue | public void setDefaultValue(Object defaultValue)(Code) | | Set the default value for this iteration, which will be a value that
is guaranteed to be returned as a member of the iteration. To guarantee
that the default value is only returned if it has not already been
returned by the iterator, setting the default value should occur before
the first call to
ConcatenatedIterator.next .
Parameters: defaultValue - The default value for the iteration, or null forthere to be no default value. The default defaultvalue is null. |
|
|