Module org.snmp4j.agent
Package org.snmp4j.agent.request
Class SubRequestIteratorSupport<S extends SubRequest<?>>
java.lang.Object
org.snmp4j.agent.request.SubRequestIteratorSupport<S>
- All Implemented Interfaces:
Iterator<S>,SubRequestIterator<S>
public class SubRequestIteratorSupport<S extends SubRequest<?>>
extends Object
implements SubRequestIterator<S>
This support class allows to implement a
SubRequestIterator instance based on an Iterator
that iterates on SubRequest instances.- Version:
- 3.1.0
- Author:
- Frank Fock
-
Constructor Summary
ConstructorsConstructorDescriptionSubRequestIteratorSupport(Iterator<?> subRequests) Creates aSubRequestIteratorthat decorates anIterator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Returnstrueif there are more sub-requests to process.protected SmapToSubRequest(Object element) Returns theSubRequestcontained or represented by the supplied object (element of the iterator).next()Gets the next sub-request that is pending.voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
SubRequestIteratorSupport
Creates aSubRequestIteratorthat decorates anIterator.- Parameters:
subRequests- anIteratoronSubRequestinstances or instances of other objects ifmapToSubRequest(Object element)is implemented (overwritten) accordingly.
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:SubRequestIteratorReturnstrueif there are more sub-requests to process. In other words, returnstrueif next would return an element rather than throwing an exception.- Specified by:
hasNextin interfaceIterator<S extends SubRequest<?>>- Specified by:
hasNextin interfaceSubRequestIterator<S extends SubRequest<?>>- Returns:
trueif there are more sub-requests.
-
next
Description copied from interface:SubRequestIteratorGets the next sub-request that is pending.- Specified by:
nextin interfaceIterator<S extends SubRequest<?>>- Specified by:
nextin interfaceSubRequestIterator<S extends SubRequest<?>>- Returns:
- an unprocessed
SubRequestinstance.
-
remove
public void remove()- Specified by:
removein interfaceIterator<S extends SubRequest<?>>
-
mapToSubRequest
Returns theSubRequestcontained or represented by the supplied object (element of the iterator). The default implementation simply casts the supplied object toSubRequest.- Parameters:
element- an Object from which aSubRequestcan be deduced.- Returns:
- a
SubRequestinstance.
-