home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / CookieEnumerator.java < prev    next >
Text File  |  1997-10-25  |  2KB  |  61 lines

  1. /*  ********************************************************************************
  2.     CookieEnumerator.java **********************************************************
  3.     ********************************************************************************  */
  4.  
  5. package aspcomp;
  6.  
  7. import com.ms.com.*;
  8. import java.util.*;
  9.  
  10. /**
  11.  * Enumeration of cookie collections.
  12.  */
  13.  
  14. public class CookieEnumerator extends VariantEnumerator
  15. {
  16.  
  17. /*  ********************************************************************************
  18.     Constructor ********************************************************************
  19.     ********************************************************************************  */
  20.  
  21.     public CookieEnumerator(IEnumVariant iev, CookieDictionary dict)
  22.     {
  23.         super(iev);
  24.         m_dict = dict;
  25.     }
  26.  
  27.  
  28. /*  ********************************************************************************
  29.     Internal (Private) Variables ***************************************************
  30.     ********************************************************************************  */
  31.  
  32.     private CookieDictionary m_dict;
  33.  
  34.  
  35. /*  ********************************************************************************
  36.     External (Public) Access Methods ***********************************************
  37.     ********************************************************************************  */
  38.  
  39.     // This method overrides the definition in VariantEnumerator
  40.     public Object nextElement() 
  41.         throws NoSuchElementException,
  42.                ClassCastException,
  43.                AspComponentException
  44.     {
  45.         Variant varName = nextVariant();
  46.         String  strName = null;
  47.  
  48.         try 
  49.         {
  50.             strName = varName.toString();
  51.         }
  52.  
  53.         catch (ClassCastException cce) 
  54.         {
  55.             throw new NoSuchElementException();
  56.         }
  57.  
  58.         return m_dict.getCookie(strName);
  59.     }
  60. }
  61.