org.melati.util
Class HttpHeader.FieldIterator

Package class diagram package HttpHeader.FieldIterator
java.lang.Object
  extended by org.melati.util.HttpHeader.FieldIterator
All Implemented Interfaces:
Enumeration, Iterator
Direct Known Subclasses:
HttpHeader.TokenAndQValueIterator, HttpHeader.WordIterator
Enclosing class:
HttpHeader

public abstract class HttpHeader.FieldIterator
extends Object
implements Iterator, Enumeration

Abstract enumeration of fields.

Subtypes decide what type of token to return and how to represent it.

This class serves to remove doubts about whether we should and can implement Iterator or Enumeration and proves itself unnecessary ;-). But we can factor stuff out and re-use it later.

Actually, it also removes the need to think about exceptions in subtypes.


Constructor Summary
HttpHeader.FieldIterator()
           
 
Method Summary
 boolean hasMoreElements()
          
 boolean hasNext()
          
 Object next()
          Return the next element or an exception.
 Object nextElement()
          
abstract  Object nextToken()
           
 void remove()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpHeader.FieldIterator

public HttpHeader.FieldIterator()
Method Detail

hasMoreElements

public final boolean hasMoreElements()

Specified by:
hasMoreElements in interface Enumeration
See Also:
Enumeration.hasMoreElements()

nextElement

public final Object nextElement()

Specified by:
nextElement in interface Enumeration
See Also:
Enumeration.nextElement()

hasNext

public final boolean hasNext()

Specified by:
hasNext in interface Iterator
See Also:
Iterator.hasNext(), next()

remove

public void remove()
            throws UnsupportedOperationException

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException
See Also:
Iterator.remove()

next

public Object next()
Return the next element or an exception.

Specified by:
next in interface Iterator
Returns:
An exception if an object of the anticipated type cannot be returned

nextToken

public abstract Object nextToken()
                          throws HttpHeader.HttpHeaderException
Returns:
the next token or throws an exception
Throws:
HttpHeader.HttpHeaderException


Copyright © 2000-2010 PanEris. All Rights Reserved.