simple.util.net
Interface CookieCollection

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CookieParser

public interface CookieCollection
extends java.io.Serializable

The CookieCollection object is used to represent a collection of one or more Cookie's. This collection of cookies iterates through the set of cookies using the hasMore and next methods. The reset method is used to start from the first cookie. This allows the collection to be used again.

The CookieCollection is Serializable so it can be stored. This allows the user to keep the cookies from the list for permenant storage. This does not extend the Collection interface because it is a simple iterator that is used with the CookieParser object.

Author:
Niall Gallagher

Method Summary
 boolean hasMore()
          This is used to determine wheather or not there are any more Cookies left in the collection.
 Cookie next()
          The next method is used to retrive the next Cookie in the list.
 void reset()
          This is used so that the collection of Cookies can be reiterated.
 

Method Detail

hasMore

boolean hasMore()
This is used to determine wheather or not there are any more Cookies left in the collection. If this returns false the collection may be reiterated through using the reset method. If this returns true then the next method will produce a valid Cookie object.

Returns:
this returns true if there are any more left

next

Cookie next()
The next method is used to retrive the next Cookie in the list. This guarantees to return a valid Cookie if the hasMore method returns true.

Returns:
this returns a valid Cookie object if the hasMore method returns true

reset

void reset()
This is used so that the collection of Cookies can be reiterated. This allows the collection to be reused.