01: /*
02: * $Id: SingleBindingEnumeration.java,v 1.4 2002/09/16 08:05:02 jkl Exp $
03: *
04: * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
05: *
06: * Use is subject to license terms, as defined in
07: * Anvil Sofware License, Version 1.1. See LICENSE
08: * file, or http://njet.org/license-1.1.txt
09: */
10: package anvil.core;
11:
12: import anvil.java.util.BindingEnumeration;
13:
14: /**
15: * class SingleBindingEnumeration
16: *
17: * @author: Jani Lehtimäki
18: */
19: public class SingleBindingEnumeration implements BindingEnumeration {
20:
21: private boolean _hasMore = true;
22: private Object _key;
23: private Object _value;
24:
25: public SingleBindingEnumeration(Object value) {
26: _key = Any.ZERO;
27: _value = value;
28: }
29:
30: public SingleBindingEnumeration(Object key, Object value) {
31: _key = key;
32: _value = value;
33: }
34:
35: public boolean hasMoreElements() {
36: return _hasMore;
37: }
38:
39: public Object nextElement() {
40: _hasMore = false;
41: return _value;
42: }
43:
44: public Object nextKey() {
45: return _key;
46: }
47:
48: }
|