public class SubRequestIteratorSupport<S extends SubRequest> extends Object implements SubRequestIterator<S>
SubRequestIterator
instance based on an Iterator
that iterates on
SubRequest
instances.Constructor and Description |
---|
SubRequestIteratorSupport(Iterator subRequests)
Creates a
SubRequestIterator that decorates an
Iterator . |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns
true if there are more sub-requests to process. |
protected S |
mapToSubRequest(Object element)
Returns the
SubRequest contained or represented by the
supplied object (element of the iterator). |
S |
next()
Gets the next sub-request that is pending.
|
void |
remove() |
public SubRequestIteratorSupport(Iterator subRequests)
SubRequestIterator
that decorates an
Iterator
.subRequests
- an Iterator
on SubRequest
instances or instances
of other objects if mapToSubRequest(Object element)
is
implemented (overwritten) accordingly.public boolean hasNext()
SubRequestIterator
true
if there are more sub-requests to process.
In other words, returns true
if next would return an element
rather than throwing an exception.hasNext
in interface Iterator<S extends SubRequest>
hasNext
in interface SubRequestIterator<S extends SubRequest>
true
if there are more sub-requests.public S next()
SubRequestIterator
next
in interface Iterator<S extends SubRequest>
next
in interface SubRequestIterator<S extends SubRequest>
SubRequest
instance.public void remove()
remove
in interface Iterator<S extends SubRequest>
protected S mapToSubRequest(Object element)
SubRequest
contained or represented by the
supplied object (element of the iterator). The default implementation
simply casts the supplied object to SubRequest
.element
- an Object from which a SubRequest
can be deduced.SubRequest
instance.Copyright © 2016 SNMP4J.org. All rights reserved.