01: /*
02: * @(#)MapEnumeration.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package org.pnuts.lib;
10:
11: import java.util.*;
12:
13: class MapEnumeration implements Enumeration {
14: private Enumeration en;
15:
16: protected MapEnumeration() {
17: }
18:
19: public MapEnumeration(Enumeration en) {
20: this .en = en;
21: }
22:
23: protected Object map(Object obj) {
24: return obj;
25: }
26:
27: public boolean hasMoreElements() {
28: return en.hasMoreElements();
29: }
30:
31: public Object nextElement() {
32: return map(en.nextElement());
33: }
34: }
|