KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > util > Enumerator


1 package org.openejb.util;
2
3 public class Enumerator implements java.io.Serializable JavaDoc, java.util.Enumeration JavaDoc {
4     
5     private java.util.Vector JavaDoc _list;
6     private int _index;
7
8     public Enumerator( java.util.Vector JavaDoc list ) {
9         _list = (java.util.Vector JavaDoc)list.clone();
10         _index = 0;
11     }
12
13     public boolean hasMoreElements() {
14         return( _index < _list.size() );
15     }
16
17     public Object JavaDoc nextElement() {
18         return _list.elementAt( _index++ );
19     }
20 }
21
Popular Tags