Class ExpressionPool.ClosedHash

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    ExpressionPool

    public static final class ExpressionPool.ClosedHash
    extends java.lang.Object
    implements java.io.Serializable
    expression cache by closed hash. Special care has to be taken wrt threading. This implementation allows get and put method to be called simulatenously.
    See Also:
    Serialized Form
    • Field Detail

      • table

        private Expression[] table
        The hash table data.
      • count

        private int count
        The total number of mappings in the hash table.
      • threshold

        private int threshold
        The table is rehashed when its size exceeds this threshold. (The value of this field is (int)(capacity * loadFactor).)
      • loadFactor

        private static final float loadFactor
        The load factor for the hashtable.
        See Also:
        Constant Field Values
      • parent

        private ExpressionPool.ClosedHash parent
        The parent hash table. can be null. items in the parent hash table will be returned by get method.

        The field is essentially final but because of the serialization support we cannot mark it as such.

      • serialPersistentFields

        private static final java.io.ObjectStreamField[] serialPersistentFields
    • Method Detail

      • rehash

        private void rehash()
        rehash. It is possible for one thread to call get method while another thread is performing rehash. Keep this in mind.
      • put

        public void put​(Expression newExp)
        put method. No two threads can call this method simulatenously, and it's the caller's responsibility to enforce it.
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream s)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        private void readObject​(java.io.ObjectInputStream s)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException