Package org.apache.http.message
Class BasicListHeaderIterator
- java.lang.Object
-
- org.apache.http.message.BasicListHeaderIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Object>
,HeaderIterator
public class BasicListHeaderIterator extends java.lang.Object implements HeaderIterator
- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description BasicListHeaderIterator(java.util.List<Header> headers, java.lang.String name)
Creates a new header iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Indicates whether there is another header in this iteration.java.lang.Object
next()
Returns the next header.Header
nextHeader()
Obtains the next header from this iteration.void
remove()
Removes the header that was returned last.
-
-
-
Constructor Detail
-
BasicListHeaderIterator
public BasicListHeaderIterator(java.util.List<Header> headers, java.lang.String name)
Creates a new header iterator.- Parameters:
headers
- a list of headers over which to iteratename
- the name of the headers over which to iterate, ornull
for any
-
-
Method Detail
-
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 interfacejava.util.Iterator<java.lang.Object>
- Returns:
true
if there is another header,false
otherwise
-
nextHeader
public Header nextHeader() throws java.util.NoSuchElementException
Obtains the next header from this iteration.- Specified by:
nextHeader
in interfaceHeaderIterator
- Returns:
- the next header in this iteration
- Throws:
java.util.NoSuchElementException
- if there are no more headers
-
next
public final java.lang.Object next() throws java.util.NoSuchElementException
Returns the next header. Same asnextHeader
, but not type-safe.- Specified by:
next
in interfacejava.util.Iterator<java.lang.Object>
- Returns:
- the next header in this iteration
- Throws:
java.util.NoSuchElementException
- if there are no more headers
-
remove
public void remove() throws java.lang.UnsupportedOperationException
Removes the header that was returned last.- Specified by:
remove
in interfacejava.util.Iterator<java.lang.Object>
- Throws:
java.lang.UnsupportedOperationException
-
-