Class CacheTable<K>

java.lang.Object
com.sun.corba.ee.impl.misc.CacheTable<K>

public class CacheTable<K> extends Object
This is a hash table implementation that simultaneously maps key to value and value to key. It is used for marshalling and unmarshalling value types, where it is necessary to track the correspondence between object instances and their offsets in a stream. It is also used for tracking indirections for Strings that represent codebases and repositoryids. Since the offset is always non-negative, only non-negative values should be stored here (and storing -1 will cause failures). Also note that the same key (Object) may be stored with multiple values (int offsets) due to the way readResolve works (see also GlassFish issue 1605).
Since:
1.1
Author:
Ken Cavanaugh
  • Constructor Summary

    Constructors
    Constructor
    Description
    CacheTable(String cacheType, ORB orb, boolean u)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
     
    final boolean
    containsVal(int val)
     
    void
     
    final K
    getKey(int val)
    Return the key where (key,val) is present in the map.
    final int
    getVal(K key)
    Returns some int val where (key,val) is in this CacheTable.
    final void
    put(K key, int val)
    Store the (key,val) pair in the hash table, unless (key,val) is already present.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CacheTable

      public CacheTable(String cacheType, ORB orb, boolean u)
  • Method Details

    • put

      public final void put(K key, int val)
      Store the (key,val) pair in the hash table, unless (key,val) is already present. Returns true if a new (key,val) pair was added, else false. val must be non-negative, but this is not checked.
      Parameters:
      key - Key for table
      val - Non-negative value
    • containsKey

      public final boolean containsKey(K key)
    • getVal

      public final int getVal(K key)
      Returns some int val where (key,val) is in this CacheTable.
      Parameters:
      key - Key to lookup
      Returns:
      Value found
    • containsVal

      public final boolean containsVal(int val)
    • getKey

      public final K getKey(int val)
      Return the key where (key,val) is present in the map.
      Parameters:
      val - Value to lookup
      Returns:
      Key for the value
    • done

      public void done()