public class OrderedHashtable
extends java.util.Hashtable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
Constructor and Description |
---|
OrderedHashtable()
Constructs a new, empty hashtable with a default initial capacity (11) and load factor, which is 0.75.
|
OrderedHashtable(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75.
|
OrderedHashtable(int initialCapacity,
float loadFactor)
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.
|
OrderedHashtable(java.util.Map t)
Constructs a new hashtable with the same mappings as the given Map.
|
Modifier and Type | Method and Description |
---|---|
java.util.Enumeration |
keys()
Returns an enumeration of the keys in this hashtable in the order in which
the elements are inserted.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified value in this hashtable with its order preserved.
|
java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this hashtable.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, toString, values
public static final java.lang.String COPYRIGHT
public OrderedHashtable()
public OrderedHashtable(int initialCapacity)
initialCapacity
- the initial capacity of the hashtablepublic OrderedHashtable(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the hashtableloadFactor
- the load factor of the hashtablepublic OrderedHashtable(java.util.Map t)
t
- the map whose mappings are to be placed in this mappublic java.util.Enumeration keys()
keys
in class java.util.Hashtable
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in class java.util.Hashtable
key
- the hashtable keyvalue
- the valuenull
if it does not have a value.public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in class java.util.Hashtable
key
- the key that needs to be removednull
if the key does not have a mapping.