Moving modules around so the runtime is under one master pom and can be built without building other modules that are in the repository
2 * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
29 * The <code>Dictionary</code> class is the abstract parent of any
30 * class, such as <code>Hashtable</code>, which maps keys to values.
31 * Every key and every value is an object. In any one <tt>Dictionary</tt>
32 * object, every key is associated with at most one value. Given a
33 * <tt>Dictionary</tt> and a key, the associated element can be looked up.
34 * Any non-<code>null</code> object can be used as a key and as a value.
36 * As a rule, the <code>equals</code> method should be used by
37 * implementations of this class to decide if two keys are the same.
39 * <strong>NOTE: This class is obsolete. New implementations should
40 * implement the Map interface, rather than extending this class.</strong>
44 * @see java.lang.Object#equals(java.lang.Object)
45 * @see java.lang.Object#hashCode()
46 * @see java.util.Hashtable
50 class Dictionary<K,V> {
52 * Sole constructor. (For invocation by subclass constructors, typically
59 * Returns the number of entries (distinct keys) in this dictionary.
61 * @return the number of keys in this dictionary.
63 abstract public int size();
66 * Tests if this dictionary maps no keys to value. The general contract
67 * for the <tt>isEmpty</tt> method is that the result is true if and only
68 * if this dictionary contains no entries.
70 * @return <code>true</code> if this dictionary maps no keys to values;
71 * <code>false</code> otherwise.
73 abstract public boolean isEmpty();
76 * Returns an enumeration of the keys in this dictionary. The general
77 * contract for the keys method is that an <tt>Enumeration</tt> object
78 * is returned that will generate all the keys for which this dictionary
81 * @return an enumeration of the keys in this dictionary.
82 * @see java.util.Dictionary#elements()
83 * @see java.util.Enumeration
85 abstract public Enumeration<K> keys();
88 * Returns an enumeration of the values in this dictionary. The general
89 * contract for the <tt>elements</tt> method is that an
90 * <tt>Enumeration</tt> is returned that will generate all the elements
91 * contained in entries in this dictionary.
93 * @return an enumeration of the values in this dictionary.
94 * @see java.util.Dictionary#keys()
95 * @see java.util.Enumeration
97 abstract public Enumeration<V> elements();
100 * Returns the value to which the key is mapped in this dictionary.
101 * The general contract for the <tt>isEmpty</tt> method is that if this
102 * dictionary contains an entry for the specified key, the associated
103 * value is returned; otherwise, <tt>null</tt> is returned.
105 * @return the value to which the key is mapped in this dictionary;
106 * @param key a key in this dictionary.
107 * <code>null</code> if the key is not mapped to any value in
109 * @exception NullPointerException if the <tt>key</tt> is <tt>null</tt>.
110 * @see java.util.Dictionary#put(java.lang.Object, java.lang.Object)
112 abstract public V get(Object key);
115 * Maps the specified <code>key</code> to the specified
116 * <code>value</code> in this dictionary. Neither the key nor the
117 * value can be <code>null</code>.
119 * If this dictionary already contains an entry for the specified
120 * <tt>key</tt>, the value already in this dictionary for that
121 * <tt>key</tt> is returned, after modifying the entry to contain the
122 * new element. <p>If this dictionary does not already have an entry
123 * for the specified <tt>key</tt>, an entry is created for the
124 * specified <tt>key</tt> and <tt>value</tt>, and <tt>null</tt> is
127 * The <code>value</code> can be retrieved by calling the
128 * <code>get</code> method with a <code>key</code> that is equal to
129 * the original <code>key</code>.
131 * @param key the hashtable key.
132 * @param value the value.
133 * @return the previous value to which the <code>key</code> was mapped
134 * in this dictionary, or <code>null</code> if the key did not
135 * have a previous mapping.
136 * @exception NullPointerException if the <code>key</code> or
137 * <code>value</code> is <code>null</code>.
138 * @see java.lang.Object#equals(java.lang.Object)
139 * @see java.util.Dictionary#get(java.lang.Object)
141 abstract public V put(K key, V value);
144 * Removes the <code>key</code> (and its corresponding
145 * <code>value</code>) from this dictionary. This method does nothing
146 * if the <code>key</code> is not in this dictionary.
148 * @param key the key that needs to be removed.
149 * @return the value to which the <code>key</code> had been mapped in this
150 * dictionary, or <code>null</code> if the key did not have a
152 * @exception NullPointerException if <tt>key</tt> is <tt>null</tt>.
154 abstract public V remove(Object key);