KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > EnumeratorIterator


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.jsp;
6
7 import java.util.Enumeration JavaDoc;
8 import java.util.Iterator JavaDoc;
9
10
11 /**
12  * @author $Author: plightbo $
13  * @version $Revision: 1.4 $
14  */

15 public class EnumeratorIterator implements Iterator JavaDoc {
16     //~ Instance fields ////////////////////////////////////////////////////////
17

18     Enumeration JavaDoc e;
19
20     //~ Constructors ///////////////////////////////////////////////////////////
21

22     public EnumeratorIterator(Enumeration JavaDoc e) {
23         this.e = e;
24     }
25
26     //~ Methods ////////////////////////////////////////////////////////////////
27

28     public boolean hasNext() {
29         return e.hasMoreElements();
30     }
31
32     public Object JavaDoc next() {
33         return e.nextElement();
34     }
35
36     public void remove() {
37         throw new UnsupportedOperationException JavaDoc("Cannot remove elements from an Enumerator");
38     }
39 }
40
Popular Tags