Payload - The payload type.public final class ProtectingBidirectionalIterator<Payload> extends AbstractProtectedBidirectionalIterator<Payload>
ProtectingBidirectionalIterator is an
AbstractProtectedIterator that can be wrapped around a given
BidirectionalIterator and guarantees that every call to
AbstractProtectedIterator.remove() throws an
UnsupportedOperationException and doesn't alter the underlying
Iterator.| Constructor and Description |
|---|
ProtectingBidirectionalIterator(BidirectionalIterator<? extends Payload> iterator)
Creates a new
ProtectingBidirectionalIterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
boolean |
hasPrevious()
Returns whether this
BidirectionalIterator has a previous
element. |
Payload |
next() |
Payload |
previous()
Returns the previous element.
|
removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoveforEachRemainingpublic ProtectingBidirectionalIterator(BidirectionalIterator<? extends Payload> iterator) throws IllegalArgumentException
ProtectingBidirectionalIterator.iterator - The BidirectionalIterator to iterate over.IllegalArgumentException - If the given BidirectionalIterator is null
.public boolean hasNext()
public Payload next() throws NoSuchElementException
NoSuchElementExceptionpublic boolean hasPrevious()
BidirectionalIteratorBidirectionalIterator has a previous
element.BidirectionalIterator has a previous
element.public Payload previous() throws NoSuchElementException
BidirectionalIteratorNoSuchElementException - If this BidirectionalIterator has no previous
element.Copyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.