Agent System POND 1.0 (1.7.2000)

FIM.Util.WWW.Cookies
Class CookieEnumeration

java.lang.Object
  |
  +--FIM.Util.FilterEnumeration
        |
        +--FIM.Util.WWW.Cookies.CookieEnumeration

public class CookieEnumeration
extends FilterEnumeration

An enumeration of cookies from a list matching a certain domain and/or path.

Version:
1.0, 1.7.2000
Author:
Michael Sonntag
See Also:
Cookie, CookieStore

Field Summary
protected  String domain
          The domain for filtering.
protected  String path
          The path for filtering.
 
Constructor Summary
CookieEnumeration(Enumeration cookies, String domain, String path)
          Creates a new enumeration of matching cookies from a list.
 
Method Summary
protected  boolean matchesFilter(Object toTest)
          The function implementing the filtering function.
 Cookie nextCookie()
          Returns the next matching cookie from the store.
 
Methods inherited from class FIM.Util.FilterEnumeration
hasMoreElements, nextElement, setBaseEnumeration
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domain

protected String domain
The domain for filtering.

path

protected String path
The path for filtering.
Constructor Detail

CookieEnumeration

public CookieEnumeration(Enumeration cookies,
                         String domain,
                         String path)
Creates a new enumeration of matching cookies from a list. If a parameter is null, all cookies will match it.
Parameters:
cookies - the list of all cookies which will be filtered
domain - the domain the returned cookies are from (if null ignored)
path - the path the returned cookies are valid for (if null ignored)
Method Detail

matchesFilter

protected boolean matchesFilter(Object toTest)
The function implementing the filtering function. If path or domain is null, all cookies will match it.
Parameters:
totest - the object to test if it matches the filter
Returns:
true if the element should be returned; false if this element does not match the criteria and should be suppressed
Overrides:
matchesFilter in class FilterEnumeration

nextCookie

public Cookie nextCookie()
Returns the next matching cookie from the store.
Returns:
the next matching cookie
Throws:
NoSuchElementException - if no more matching cookies exits

Agent System POND 1.0 (1.7.2000)

Submit a bug

Copyright 2000 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.