Module openj9.dtfj

Class ObjectMap

  • All Implemented Interfaces:
    Serializable

    public final class ObjectMap
    extends AbstractHashMap
    This is a simple class to map an integer key to an object value. It has a smaller footprint than the various standard Java classes owing to the use of open addressing (see description of AbstractHashMap).
    See Also:
    Serialized Form
    • Constructor Detail

      • ObjectMap

        public ObjectMap()
    • Method Detail

      • get

        public Object get​(long key)
        Returns the value mapped by the given key.
        Returns:
        the value or null if it cannot be found
      • put

        public void put​(long key,
                        Object value)
        Add the key/value pair to the map.
      • remove

        public Object remove​(long key)
        Remove the key from the map and return the old value.
      • toArray

        public Object[] toArray​(Object[] a)
        Returns an array containing the values where the returned runtime array type is derived from the given array (or the given array is simply reused if there is room).