com.ibm.commerce.tools.util

Class OrderedHashtable

  • java.lang.Object
    • java.util.Dictionary<K,V>
      • java.util.Hashtable
        • com.ibm.commerce.tools.util.OrderedHashtable
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map


    public class OrderedHashtable
    extends java.util.Hashtable
    Implements a hashtable which preserves the order.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
    • Constructor Summary

      Constructors 
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.util.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
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderedHashtable

        public OrderedHashtable()
        Constructs a new, empty hashtable with a default initial capacity (11) and load factor, which is 0.75.
      • OrderedHashtable

        public OrderedHashtable(int initialCapacity)
        Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75.
        Parameters:
        initialCapacity - the initial capacity of the hashtable
      • OrderedHashtable

        public OrderedHashtable(int initialCapacity,
                                float loadFactor)
        Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.
        Parameters:
        initialCapacity - the initial capacity of the hashtable
        loadFactor - the load factor of the hashtable
      • OrderedHashtable

        public OrderedHashtable(java.util.Map t)
        Constructs a new hashtable with the same mappings as the given Map. The hashtable is created with an initial capacity sufficient to hold the mappings in the given Map and a default load factor, which is 0.75.
        Parameters:
        t - the map whose mappings are to be placed in this map
    • Method Detail

      • keys

        public java.util.Enumeration keys()
        Returns an enumeration of the keys in this hashtable in the order in which the elements are inserted.
        Overrides:
        keys in class java.util.Hashtable
        Returns:
        An enumeration of the keys in this hashtable.
      • put

        public 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. Neither the key nor the value can be null.
        Specified by:
        put in interface java.util.Map
        Overrides:
        put in class java.util.Hashtable
        Parameters:
        key - the hashtable key
        value - the value
        Returns:
        The previous value of the specified key in this hashtable, or null if it does not have a value.
      • remove

        public java.lang.Object remove(java.lang.Object key)
        Removes the key (and its corresponding value) from this hashtable. This method does nothing if the key is not in the hashtable.
        Specified by:
        remove in interface java.util.Map
        Overrides:
        remove in class java.util.Hashtable
        Parameters:
        key - the key that needs to be removed
        Returns:
        The value which the key had been mapped in this hashtable, or null if the key does not have a mapping.