Package org.apache.http.message
Class BasicHeaderIterator
- java.lang.Object
-
- org.apache.http.message.BasicHeaderIterator
-
- All Implemented Interfaces:
Iterator<Object>,HeaderIterator
public class BasicHeaderIterator extends Object implements HeaderIterator
Basic implementation of aHeaderIterator.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description BasicHeaderIterator(Header[] headers, String name)Creates a new header iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Indicates whether there is another header in this iteration.Objectnext()Returns the next header.HeadernextHeader()Obtains the next header from this iteration.voidremove()Removing headers is not supported.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:HeaderIteratorIndicates whether there is another header in this iteration.- Specified by:
hasNextin interfaceHeaderIterator- Specified by:
hasNextin interfaceIterator<Object>- Returns:
trueif there is another header,falseotherwise
-
nextHeader
public Header nextHeader() throws NoSuchElementException
Obtains the next header from this iteration.- Specified by:
nextHeaderin interfaceHeaderIterator- Returns:
- the next header in this iteration
- Throws:
NoSuchElementException- if there are no more headers
-
next
public final Object next() throws NoSuchElementException
Returns the next header. Same asnextHeader, but not type-safe.- Specified by:
nextin interfaceIterator<Object>- Returns:
- the next header in this iteration
- Throws:
NoSuchElementException- if there are no more headers
-
remove
public void remove() throws UnsupportedOperationExceptionRemoving headers is not supported.- Specified by:
removein interfaceIterator<Object>- Throws:
UnsupportedOperationException- always
-
-