Package org.apache.http.message
Class BasicHeaderIterator
- java.lang.Object
-
- org.apache.http.message.BasicHeaderIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Object>,HeaderIterator
public class BasicHeaderIterator extends java.lang.Object implements HeaderIterator
Basic implementation of aHeaderIterator.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description BasicHeaderIterator(Header[] headers, java.lang.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.java.lang.Objectnext()Returns the next header.HeadernextHeader()Obtains the next header from this iteration.voidremove()Removing headers is not supported.
-
-
-
Constructor Detail
-
BasicHeaderIterator
public BasicHeaderIterator(Header[] headers, java.lang.String name)
Creates a new header iterator.- Parameters:
headers- an array of headers over which to iteratename- the name of the headers over which to iterate, ornullfor any
-
-
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 interfacejava.util.Iterator<java.lang.Object>- Returns:
trueif there is another header,falseotherwise
-
nextHeader
public Header nextHeader() throws java.util.NoSuchElementException
Obtains the next header from this iteration.- Specified by:
nextHeaderin 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.NoSuchElementExceptionReturns the next header. Same asnextHeader, but not type-safe.- Specified by:
nextin 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.UnsupportedOperationExceptionRemoving headers is not supported.- Specified by:
removein interfacejava.util.Iterator<java.lang.Object>- Throws:
java.lang.UnsupportedOperationException- always
-
-