Class IntObjMap<E>

Type Parameters:
E - generic value type

public final class IntObjMap<E> extends IntSet
This is an efficient and memory-saving hash map for storing primitive integers and objects. It extends the IntSet class.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • IntObjMap

      public IntObjMap()
      Default constructor.
  • Method Details

    • put

      public E put(int key, E value)
      Indexes the specified key and stores the associated value. If the key already exists, the value is updated.
      Parameters:
      key - key
      value - value
      Returns:
      old value
    • computeIfAbsent

      public E computeIfAbsent(int key, Supplier<? extends E> func)
      Returns the value for the specified key. Creates a new value if none exists.
      Parameters:
      key - key
      func - function that create a new value
      Returns:
      value
    • get

      public E get(int key)
      Returns the value for the specified key.
      Parameters:
      key - key to be looked up
      Returns:
      value or null if the key was not found
    • values

      public Iterable<E> values()
      Returns a value iterator.
      Returns:
      iterator
    • rehash

      protected void rehash(int newSize)
      Description copied from class: ASet
      Rehashes all entries.
      Overrides:
      rehash in class IntSet
      Parameters:
      newSize - new hash size
    • clear

      public void clear()
      Description copied from class: ASet
      Resets the data structure.
      Overrides:
      clear in class ASet
    • toString

      public String toString()
      Overrides:
      toString in class IntSet