01: package org.mockejb.jms;
02:
03: import java.util.Enumeration;
04: import java.util.Iterator;
05:
06: /**
07: * Enumeration for <code>Collection</code> represented with an iterator.
08: * @author Dimitar Gospodinov
09: */
10: class CollectionEnumeration implements Enumeration {
11: private Iterator it;
12:
13: /**
14: * Creates enumeration for the specified iterator.
15: * @param it
16: */
17: CollectionEnumeration(Iterator it) {
18: this .it = it;
19: }
20:
21: /**
22: * @see java.util.Enumeration#hasMoreElements()
23: */
24: public boolean hasMoreElements() {
25: return it.hasNext();
26: }
27:
28: /**
29: * @see java.util.Enumeration#nextElement()
30: */
31: public Object nextElement() {
32: return it.next();
33: }
34: }
|