Parsing Engine

danbikel.lisp
Class SexpList.HashCache

java.lang.Object
  extended by danbikel.lisp.Sexp
      extended by danbikel.lisp.SexpList
          extended by danbikel.lisp.SexpList.HashCache
All Implemented Interfaces:
Externalizable, Serializable
Enclosing class:
SexpList

public static final class SexpList.HashCache
extends SexpList

A subclass of SexpList where a precomputed, cached hash value is stored with every instance.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class danbikel.lisp.SexpList
SexpList.HashCache
 
Field Summary
 
Fields inherited from class danbikel.lisp.SexpList
emptyList
 
Constructor Summary
SexpList.HashCache()
          Creates a new, empty HashCache list.
 
Method Summary
 boolean equals(Object obj)
          Test the specified object for equality to this list.
protected  void finalize()
          Updates class-level information when this object dies.
 int hashCode()
          Returns the precomputed hash value for this list.
 void readExternal(ObjectInput in)
          Reads this object from an ObjectInput instance.
 
Methods inherited from class danbikel.lisp.SexpList
add, add, addAll, addAll, clear, contains, deepCopy, ensureCapacity, first, get, getCanonical, getChildLabel, indexOf, isAllSymbols, isList, isSymbol, iterator, last, length, listAt, remove, reverse, set, setChildLabel, size, symbolAt, toString, trimToSize, trimToSizeRecursive, writeExternal
 
Methods inherited from class danbikel.lisp.Sexp
getCanonical, list, main, read, read, read, symbol
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SexpList.HashCache

public SexpList.HashCache()
Creates a new, empty HashCache list.

Method Detail

hashCode

public int hashCode()
Returns the precomputed hash value for this list.

Overrides:
hashCode in class SexpList
Returns:
the precomputed hash value for this list.

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Description copied from class: SexpList
Reads this object from an ObjectInput instance.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class SexpList
Parameters:
in - the object stream from which to read objects of this class
Throws:
IOException - if the underlying read operation throws an IOException
ClassNotFoundException - if the underlying read operation throws an ClassNotFoundException

equals

public boolean equals(Object obj)
Test the specified object for equality to this list. If the specified object is of type HashCache, then this method simply returns whether the specified object is object-equal to this object, as per the == operator; otherwise, the method SexpList.equals(Object) is used.

Overrides:
equals in class SexpList
Parameters:
obj - the object to test for equality with this object
Returns:
whether the specified object is equal to this object
See Also:
AbstractList.equals(java.lang.Object)

finalize

protected void finalize()
                 throws Throwable
Updates class-level information when this object dies.

Overrides:
finalize in class Object
Throws:
Throwable

Parsing Engine

Author: Dan Bikel.