Package org.apache.http.message
Class BasicHeaderIterator
java.lang.Object
org.apache.http.message.BasicHeaderIterator
- All Implemented Interfaces:
Iterator<Object>
,HeaderIterator
Basic implementation of a
HeaderIterator
.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionBasicHeaderIterator
(Header[] headers, String name) Creates a new header iterator. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
BasicHeaderIterator
Creates a new header iterator.- Parameters:
headers
- an array of headers over which to iteratename
- the name of the headers over which to iterate, ornull
for any
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:HeaderIterator
Indicates whether there is another header in this iteration.- Specified by:
hasNext
in interfaceHeaderIterator
- Specified by:
hasNext
in interfaceIterator<Object>
- Returns:
true
if there is another header,false
otherwise
-
nextHeader
Obtains the next header from this iteration.- Specified by:
nextHeader
in interfaceHeaderIterator
- Returns:
- the next header in this iteration
- Throws:
NoSuchElementException
- if there are no more headers
-
next
Returns the next header. Same asnextHeader
, but not type-safe.- Specified by:
next
in interfaceIterator<Object>
- Returns:
- the next header in this iteration
- Throws:
NoSuchElementException
- if there are no more headers
-
remove
Removing headers is not supported.- Specified by:
remove
in interfaceIterator<Object>
- Throws:
UnsupportedOperationException
- always
-