|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.message.BasicHeaderIterator
public class BasicHeaderIterator
Basic implementation of a HeaderIterator
.
Field Summary | |
---|---|
protected Header[] |
allHeaders
An array of headers to iterate over. |
protected int |
currentIndex
The position of the next header in allHeaders . |
protected java.lang.String |
headerName
The header name to filter by. |
Constructor Summary | |
---|---|
BasicHeaderIterator(Header[] headers,
java.lang.String name)
Creates a new header iterator. |
Method Summary | |
---|---|
protected boolean |
filterHeader(int index)
Checks whether a header is part of the iteration. |
protected int |
findNext(int from)
Determines the index of the next header. |
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()
Removing headers is not supported. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Header[] allHeaders
protected int currentIndex
allHeaders
.
Negative if the iteration is over.
protected java.lang.String headerName
null
to iterate over all headers in the array.
Constructor Detail |
---|
public BasicHeaderIterator(Header[] headers, java.lang.String name)
headers
- an array of headers over which to iteratename
- the name of the headers over which to iterate, or
null
for anyMethod Detail |
---|
protected int findNext(int from)
from
- one less than the index to consider first,
-1 to search for the first header
protected boolean filterHeader(int index)
index
- the index of the header to check
true
if the header should be part of the
iteration, false
to skippublic boolean hasNext()
HeaderIterator
hasNext
in interface java.util.Iterator
hasNext
in interface HeaderIterator
true
if there is another header,
false
otherwisepublic Header nextHeader() throws java.util.NoSuchElementException
nextHeader
in interface HeaderIterator
java.util.NoSuchElementException
- if there are no more headerspublic final java.lang.Object next() throws java.util.NoSuchElementException
nextHeader
, but not type-safe.
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if there are no more headerspublic void remove() throws java.lang.UnsupportedOperationException
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- always
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |