Package org.armedbear.lisp
Class WeakHashTable
java.lang.Object
org.armedbear.lisp.LispObject
org.armedbear.lisp.WeakHashTable
- All Implemented Interfaces:
Hashtable
,LispObject
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
protected static class
protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.armedbear.lisp.WeakHashTable.HashEntry[]
Array containing the actual key-value mappings.protected int
The actual current number of key-value pairs.protected static final float
protected final LispObject
protected final LispObject
protected int
The rounded product of the capacity and the load factor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static int
calculateInitialCapacity
(int size) classOf()
void
clear()
ENTRIES()
Deprecated.boolean
equalp
(LispObject obj) get
(LispObject key) int
getCount()
Number of entries stored in the hash buckets.protected org.armedbear.lisp.WeakHashTable.HashEntry
getEntry
(LispObject key) gethash
(LispObject key) gethash
(LispObject key, LispObject defaultValue) gethash1
(LispObject key) getParts()
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject.final LispObject
final LispObject
int
getSize()
How many hash buckets exist in the underlying data structure.getTest()
MAPHASH
(LispObject function) static WeakHashTable
newEqHashTable
(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness) static WeakHashTable
newEqlHashTable
(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness) static WeakHashTable
newEqualHashTable
(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness) static WeakHashTable
newEqualpHashTable
(int size, LispObject rehashSize, LispObject rehashThreshold, LispObject weakness) int
psxhash()
void
put
(LispObject key, LispObject value) puthash
(LispObject key, LispObject newValue) protected void
rehash()
remhash
(LispObject key) remove
(LispObject key) typeOf()
typep
(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 Details
-
loadFactor
protected static final float loadFactor- See Also:
-
rehashSize
-
rehashThreshold
-
threshold
protected int thresholdThe 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[] bucketsArray containing the actual key-value mappings. -
count
protected volatile int countThe actual current number of key-value pairs.
-
-
Method Details
-
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
-
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
- Specified by:
typeOf
in interfaceLispObject
- Overrides:
typeOf
in classLispObject
-
classOf
- Overrides:
classOf
in classLispObject
-
typep
- Overrides:
typep
in classLispObject
-
equalp
- Overrides:
equalp
in classLispObject
-
getParts
Description copied from class:LispObject
Implementing 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:
getParts
in classLispObject
-
clear
public void clear() -
gethash
-
gethash
-
gethash1
-
puthash
-
remhash
-
printObject
- Overrides:
printObject
in classLispObject
-
getTest
-
getWeakness
-
getEntry
-
get
-
put
-
remove
-
rehash
protected void rehash() -
ENTRIES
Deprecated. -
getEntries
- Specified by:
getEntries
in interfaceHashtable
-
MAPHASH
-
psxhash
public int psxhash()- Overrides:
psxhash
in classLispObject
-