|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.util.DuplexIterator
The DuplexIterator
class iterates contiguously over
two other Iterator
s. Elements from the first Iterator
are always returned before elements from the second
Iterator
. DuplexIterators
may be chained to
create a multiplexing iterator; for example:
Iterator triplexIterator(Iterator iter1, Iterator iter2, Iterator iter3) { return new DuplexIterator(new DuplexIterator(iter1, iter2), iter3); }
Constructor Summary | |
DuplexIterator(java.util.Iterator iter1,
java.util.Iterator iter2)
Constructs a DuplexIterator from two other Iterator s. |
Method Summary | |
boolean |
hasNext()
Returns true if there are more elements in either
Iterator ; otherwise false . |
java.lang.Object |
next()
Returns the next element from the first Iterator ; if the
first Iterator has no more elements, then returns the
next element from the second Iterator . |
void |
remove()
Currently unsupported; always throws an UnsupportedOperationException . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DuplexIterator(java.util.Iterator iter1, java.util.Iterator iter2)
DuplexIterator
from two other Iterator
s.
iter1
- the first Iterator
over which to iterateiter2
- the second Iterator
over which to iterateMethod Detail |
public boolean hasNext()
true
if there are more elements in either
Iterator
; otherwise false
.
hasNext
in interface java.util.Iterator
public java.lang.Object next()
Iterator
; if the
first Iterator
has no more elements, then returns the
next element from the second Iterator
.
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if there are no more elements in either
Iterator
public void remove()
UnsupportedOperationException
.
remove
in interface java.util.Iterator
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.