Class SoftDoublyIndexedTable

java.lang.Object
org.apache.batik.util.SoftDoublyIndexedTable

public class SoftDoublyIndexedTable extends Object
This class represents a doubly indexed hash table, which holds soft references to the contained values.
This HashMap is not Thread-safe.
  • Field Details

    • INITIAL_CAPACITY

      protected static final int INITIAL_CAPACITY
      The initial capacity
      See Also:
    • table

      protected SoftDoublyIndexedTable.Entry[] table
      The underlying array
    • count

      protected int count
      The number of entries
    • referenceQueue

      protected ReferenceQueue referenceQueue
      The reference queue.
  • Constructor Details

    • SoftDoublyIndexedTable

      public SoftDoublyIndexedTable()
      Creates a new SoftDoublyIndexedTable.
    • SoftDoublyIndexedTable

      public SoftDoublyIndexedTable(int c)
      Creates a new DoublyIndexedTable.
      Parameters:
      c - The inital capacity.
  • Method Details

    • size

      public int size()
      Returns the size of this table.
    • get

      public Object get(Object o1, Object o2)
      Gets the value of a variable
      Returns:
      the value or null
    • put

      public Object put(Object o1, Object o2, Object value)
      Sets a new value for the given variable
      Returns:
      the old value or null
    • clear

      public void clear()
      Clears the table.
    • rehash

      protected void rehash()
      Rehash the table
    • hashCode

      protected int hashCode(Object o1, Object o2)
      Computes a hash code corresponding to the given objects.
    • removeClearedEntries

      protected void removeClearedEntries()
      Removes the cleared entries.