Package org.armedbear.lisp
Class WeakHashTable
- java.lang.Object
-
- org.armedbear.lisp.LispObject
-
- org.armedbear.lisp.WeakHashTable
-
- All Implemented Interfaces:
Hashtable,LispObject
public class WeakHashTable extends LispObject implements Hashtable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classWeakHashTable.Comparatorprotected static classWeakHashTable.EqlComparatorprotected static classWeakHashTable.EqualComparatorprotected static classWeakHashTable.EqualpComparator
-
Field Summary
Fields Modifier and Type Field Description protected org.armedbear.lisp.WeakHashTable.HashEntry[]bucketsArray containing the actual key-value mappings.protected intcountThe actual current number of key-value pairs.protected static floatloadFactorprotected LispObjectrehashSizeprotected LispObjectrehashThresholdprotected intthresholdThe rounded product of the capacity and the load factor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static intcalculateInitialCapacity(int size)LispObjectclassOf()voidclear()LispObjectENTRIES()Deprecated.booleanequalp(LispObject obj)LispObjectget(LispObject key)intgetCount()Number of entries stored in the hash buckets.LispObjectgetEntries()protected org.armedbear.lisp.WeakHashTable.HashEntrygetEntry(LispObject key)LispObjectgethash(LispObject key)LispObjectgethash(LispObject key, LispObject defaultValue)LispObjectgethash1(LispObject key)LispObjectgetParts()Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject.LispObjectgetRehashSize()LispObjectgetRehashThreshold()intgetSize()How many hash buckets exist in the underlying data structure.SymbolgetTest()LispObjectgetWeakness()LispObjectMAPHASH(LispObject function)static WeakHashTablenewEqHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)static WeakHashTablenewEqlHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)static WeakHashTablenewEqualHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)static WeakHashTablenewEqualpHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)java.lang.StringprintObject()intpsxhash()voidput(LispObject key, LispObject value)LispObjectputhash(LispObject key, LispObject newValue)protected voidrehash()LispObjectremhash(LispObject key)LispObjectremove(LispObject key)LispObjecttypeOf()LispObjecttypep(LispObject type)-
Methods inherited from class org.armedbear.lisp.LispObject
ABS, add, add, aref, AREF, AREF, aref_long, aset, aset, aset, ash, ash, atom, ATOM, caddr, cadr, car, cddr, cdr, CHAR, characterp, CHARACTERP, chars, COMPLEXP, constantp, CONSTANTP, copyToArray, decr, DENOMINATOR, dispatch, divideBy, doubleValue, elt, endp, ENDP, EQ, eql, eql, eql, EQL, equal, equal, EQUAL, equalp, evenp, EVENP, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, floatp, FLOATP, floatValue, getBooleanValue, getCallCount, getDescription, getDocumentation, getFixnumSlotValue, getHotCount, getInstance, getPropertyList, getSlotValue, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, getSlotValueAsBoolean, getStringChars, getStringValue, getSymbolFunction, getSymbolFunctionOrDie, getSymbolSetfFunction, getSymbolSetfFunctionOrDie, getSymbolValue, incr, incrementCallCount, incrementHotCount, integerp, INTEGERP, intValue, IS_E, IS_GE, IS_GT, IS_LE, IS_LT, IS_NE, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNotEqualTo, isNotEqualTo, isSpecialOperator, isSpecialVariable, javaInstance, javaInstance, LDB, length, LENGTH, listp, LISTP, lockableInstance, LOGAND, LOGAND, LOGIOR, LOGIOR, LOGNOT, LOGXOR, LOGXOR, longValue, minusp, MINUSP, MOD, MOD, multiplyBy, multiplyBy, negate, noFillPointer, NOT, nreverse, NTH, NTH, nthcdr, numberp, NUMBERP, NUMERATOR, oddp, ODDP, plusp, PLUSP, princToString, psxhash, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCallCount, setCar, setCdr, setDocumentation, setHotCount, setPropertyList, setSlotValue, setSlotValue, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, SIMPLE_STRING_P, SLOT_VALUE, STRING, stringp, STRINGP, subtract, subtract, SVREF, svset, sxhash, SYMBOLP, truncate, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
-
-
-
-
Field Detail
-
loadFactor
protected static final float loadFactor
- See Also:
- Constant Field Values
-
rehashSize
protected final LispObject rehashSize
-
rehashThreshold
protected final LispObject rehashThreshold
-
threshold
protected int threshold
The rounded product of the capacity and the load factor. When the number of elements exceeds the threshold, the implementation calls rehash().
-
buckets
protected volatile org.armedbear.lisp.WeakHashTable.HashEntry[] buckets
Array containing the actual key-value mappings.
-
count
protected volatile int count
The actual current number of key-value pairs.
-
-
Method Detail
-
calculateInitialCapacity
protected static int calculateInitialCapacity(int size)
-
newEqHashTable
public static WeakHashTable newEqHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)
-
newEqlHashTable
public static WeakHashTable newEqlHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)
-
newEqualHashTable
public static WeakHashTable newEqualHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)
-
newEqualpHashTable
public static WeakHashTable newEqualpHashTable(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness)
-
getRehashSize
public final LispObject getRehashSize()
-
getRehashThreshold
public final LispObject getRehashThreshold()
-
getSize
public int getSize()
How many hash buckets exist in the underlying data structure.
-
getCount
public int getCount()
Number of entries stored in the hash buckets.
-
typeOf
public LispObject typeOf()
- Specified by:
typeOfin interfaceLispObject- Overrides:
typeOfin classLispObject
-
classOf
public LispObject classOf()
- Overrides:
classOfin classLispObject
-
typep
public LispObject typep(LispObject type)
- Overrides:
typepin classLispObject
-
equalp
public boolean equalp(LispObject obj)
- Overrides:
equalpin classLispObject
-
getParts
public LispObject getParts()
Description copied from class:LispObjectImplementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject. The protocol is to return a List of Cons pairs, where the car of each pair contains a decriptive string, and the cdr returns a subobject for inspection.- Overrides:
getPartsin classLispObject
-
clear
public void clear()
-
gethash
public LispObject gethash(LispObject key)
-
gethash
public LispObject gethash(LispObject key, LispObject defaultValue)
-
gethash1
public LispObject gethash1(LispObject key)
-
puthash
public LispObject puthash(LispObject key, LispObject newValue)
-
remhash
public LispObject remhash(LispObject key)
-
printObject
public java.lang.String printObject()
- Overrides:
printObjectin classLispObject
-
getTest
public Symbol getTest()
-
getWeakness
public LispObject getWeakness()
-
getEntry
protected org.armedbear.lisp.WeakHashTable.HashEntry getEntry(LispObject key)
-
get
public LispObject get(LispObject key)
-
put
public void put(LispObject key, LispObject value)
-
remove
public LispObject remove(LispObject key)
-
rehash
protected void rehash()
-
ENTRIES
@Deprecated public LispObject ENTRIES()
Deprecated.
-
getEntries
public LispObject getEntries()
- Specified by:
getEntriesin interfaceHashtable
-
MAPHASH
public LispObject MAPHASH(LispObject function)
-
psxhash
public int psxhash()
- Overrides:
psxhashin classLispObject
-
-