01: /**
02: * JavaGuard -- an obfuscation package for Java classfiles.
03: *
04: * Copyright (c) 2002 Thorsten Heit (theit@gmx.de)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: * The author may be contacted at theit@gmx.de.
21: *
22: *
23: * $Id: KeyValue.java,v 1.1.1.1 2002/04/03 13:49:44 glurk Exp $
24: */package net.sf.javaguard;
25:
26: /** Stores a key/value pair. Useful as a generic struct.
27: *
28: * @author <a href="mailto:theit@gmx.de">Thorsten Heit</a>
29: */
30: public class KeyValue {
31: /** Holds the key. */
32: private Object key;
33: /** Holds the value assigned to the key. */
34: private Object value;
35:
36: /** Initializes a new key/value pair.
37: * @param key the new key
38: * @param value the object to assign to the key
39: */
40: public KeyValue(Object key, Object value) {
41: setKey(key);
42: setValue(value);
43: }
44:
45: /** Sets the new key.
46: * @param aKey an object with the new key; may not be null
47: * @see #getKey
48: */
49: public void setKey(Object aKey) {
50: this .key = aKey;
51: }
52:
53: /** Returns the current key.
54: * @return string holding the key
55: * @see #setKey
56: */
57: public Object getKey() {
58: return key;
59: }
60:
61: /** Sets the object that is assigned to the key.
62: * @param theValue the object to assign to the key; may be null
63: * @see #getValue
64: */
65: public void setValue(Object theValue) {
66: this .value = theValue;
67: }
68:
69: /** Returns the current object assigned to the key.
70: * @return object assigned to the key; may be null
71: * @see #setValue
72: */
73: public Object getValue() {
74: return value;
75: }
76: }
|