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

Basic implementation of a com.good.gd.apache.http.HeaderIterator. More...

Inheritance diagram for BasicHeaderIterator:
HeaderIterator

Description

Version
Revision
581981

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

 BasicHeaderIterator (Header[] 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
 Removing headers is not supported. More...
 

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 Header[] allHeaders
 An array of headers to iterate over. More...
 
int currentIndex
 The position of the next header in allHeaders . More...
 
String headerName
 The header name to filter by. More...
 

Constructor & Destructor Documentation

◆ BasicHeaderIterator()

BasicHeaderIterator ( Header[]  headers,
String  name 
)
Parameters
headersan array 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

◆ remove()

void remove ( ) throws UnsupportedOperationException
Exceptions
UnsupportedOperationExceptionalways

Member Data Documentation

◆ allHeaders

final Header [] allHeaders
protected

Not all elements of this array are necessarily part of the iteration. This array will never be modified by the iterator. Derived implementations are expected to adhere to this restriction.

◆ currentIndex

int currentIndex
protected

Negative if the iteration is over.

◆ headerName

String headerName
protected

null to iterate over all headers in the array.