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 aSubRequestIteratorinstance based on anIteratorthat iterates onSubRequestinstances.- Version:
- 3.1.0
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description SubRequestIteratorSupport(Iterator<?> subRequests)Creates aSubRequestIteratorthat decorates anIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Returnstrueif there are more sub-requests to process.protected SmapToSubRequest(Object element)Returns theSubRequestcontained or represented by the supplied object (element of the iterator).Snext()Gets the next sub-request that is pending.voidremove()-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
SubRequestIteratorSupport
public SubRequestIteratorSupport(Iterator<?> subRequests)
Creates aSubRequestIteratorthat decorates anIterator.- Parameters:
subRequests- anIteratoronSubRequestinstances or instances of other objects ifmapToSubRequest(Object element)is implemented (overwritten) accordingly.
-
-
Method Detail
-
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
public S 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
protected S mapToSubRequest(Object element)
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.
-
-