| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.message.BasicListHeaderIterator
public class BasicListHeaderIterator
Implementation of a HeaderIterator based on a List.
 For use by HeaderGroup.
| Field Summary | |
|---|---|
| protected  List<Header> | allHeadersA list of headers to iterate over. | 
| protected  int | currentIndexThe position of the next header in allHeaders. | 
| protected  String | headerNameThe header name to filter by. | 
| protected  int | lastIndexThe position of the last returned header. | 
| Constructor Summary | |
|---|---|
| BasicListHeaderIterator(List<Header> headers,
                        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 pos)Determines the index of the next header. | 
|  boolean | hasNext()Indicates whether there is another header in this iteration. | 
|  Object | next()Returns the next header. | 
|  Header | nextHeader()Obtains the next header from this iteration. | 
|  void | remove()Removes the header that was returned last. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected final List<Header> allHeaders
protected int currentIndex
allHeaders.
 Negative if the iteration is over.
protected int lastIndex
protected String headerName
null to iterate over all headers in the array.
| Constructor Detail | 
|---|
public BasicListHeaderIterator(List<Header> headers,
                               String name)
headers - a list of headers over which to iteratename - the name of the headers over which to iterate, or
                  null for any| Method Detail | 
|---|
protected int findNext(int pos)
pos - 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 Iterator<Object>hasNext in interface HeaderIteratortrue if there is another header,
          false otherwise
public Header nextHeader()
                  throws NoSuchElementException
nextHeader in interface HeaderIteratorNoSuchElementException - if there are no more headers
public final Object next()
                  throws NoSuchElementException
nextHeader, but not type-safe.
next in interface Iterator<Object>NoSuchElementException - if there are no more headers
public void remove()
            throws UnsupportedOperationException
remove in interface Iterator<Object>UnsupportedOperationException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||