• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
BasicListHeaderIterator Class Reference

Implementation of a com.good.gd.apache.http.HeaderIterator based on a java.util.List. More...

Inheritance diagram for BasicListHeaderIterator:
HeaderIterator

Description

For use by com.good.gd.apache.http.message.HeaderGroup.

Version
Revision
584542

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

 BasicListHeaderIterator (List headers, String name)
 Creates a new header iterator. More...
 
boolean hasNext ()
 Indicates whether there is another header in this iteration. More...
 
Header nextHeader () throws NoSuchElementException
 Obtains the next header from this iteration. More...
 
final Object next () throws NoSuchElementException
 Returns the next header. More...
 
void remove () throws UnsupportedOperationException
 Removes the header that was returned last.
 

Protected Member Functions

int findNext (int from)
 Determines the index of the next header. More...
 
boolean filterHeader (int index)
 Checks whether a header is part of the iteration. More...
 

Protected Attributes

final List allHeaders
 A list of headers to iterate over. More...
 
int currentIndex
 The position of the next header in allHeaders . More...
 
int lastIndex
 The position of the last returned header. More...
 
String headerName
 The header name to filter by. More...
 

Constructor & Destructor Documentation

◆ BasicListHeaderIterator()

BasicListHeaderIterator ( List  headers,
String  name 
)
Parameters
headersa list of headers over which to iterate
namethe name of the headers over which to iterate, or null for any

Member Function Documentation

◆ findNext()

int findNext ( int  from)
protected
Parameters
fromone less than the index to consider first, -1 to search for the first header
Returns
the index of the next header that matches the filter name, or negative if there are no more headers

◆ filterHeader()

boolean filterHeader ( int  index)
protected
Parameters
indexthe index of the header to check
Returns
true if the header should be part of the iteration, false to skip

◆ hasNext()

boolean hasNext ( )
Returns
true if there is another header, false otherwise

Implements HeaderIterator.

◆ nextHeader()

Header nextHeader ( ) throws NoSuchElementException
Returns
the next header in this iteration
Exceptions
NoSuchElementExceptionif there are no more headers

Implements HeaderIterator.

◆ next()

final Object next ( ) throws NoSuchElementException

Same as nextHeader , but not type-safe.

Returns
the next header in this iteration
Exceptions
NoSuchElementExceptionif there are no more headers

Member Data Documentation

◆ allHeaders

final List allHeaders
protected

Not all elements of this array are necessarily part of the iteration.

◆ currentIndex

int currentIndex
protected

Negative if the iteration is over.

◆ lastIndex

int lastIndex
protected

Negative if none has been returned so far.

◆ headerName

String headerName
protected

null to iterate over all headers in the array.