Package org.armedbear.lisp
Class HashTable
- java.lang.Object
-
- org.armedbear.lisp.LispObject
-
- org.armedbear.lisp.HashTable
-
- All Implemented Interfaces:
Hashtable
,LispObject
public class HashTable extends LispObject implements Hashtable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
HashTable.Comparator
protected static class
HashTable.EqlComparator
protected static class
HashTable.EqualComparator
protected static class
HashTable.EqualpComparator
protected static class
HashTable.HashEntry
-
Field Summary
Fields Modifier and Type Field Description protected HashTable.HashEntry[]
buckets
protected int
count
protected static float
loadFactor
protected LispObject
rehashSize
protected LispObject
rehashThreshold
protected int
threshold
-
Constructor Summary
Constructors Modifier Constructor Description protected
HashTable(HashTable.Comparator c, int size, LispObject rehashSize, LispObject rehashThreshold)
-
Method Summary
-
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
-
buckets
protected volatile HashTable.HashEntry[] buckets
-
count
protected volatile int count
-
-
Constructor Detail
-
HashTable
protected HashTable(HashTable.Comparator c, int size, LispObject rehashSize, LispObject rehashThreshold)
-
-
Method Detail
-
calculateInitialCapacity
protected static int calculateInitialCapacity(int size)
-
newEqHashTable
public static HashTable newEqHashTable(int size, LispObject rehashSize, LispObject rehashThreshold)
-
newEqlHashTable
public static HashTable newEqlHashTable(int size, LispObject rehashSize, LispObject rehashThreshold)
-
newEqualHashTable
public static HashTable newEqualHashTable(int size, LispObject rehashSize, LispObject rehashThreshold)
-
newEqualpHashTable
public static LispObject newEqualpHashTable(int size, LispObject rehashSize, LispObject rehashThreshold)
-
getRehashSize
public final LispObject getRehashSize()
-
getRehashThreshold
public final LispObject getRehashThreshold()
-
getSize
public int getSize()
-
getCount
public int getCount()
-
typeOf
public LispObject typeOf()
- Specified by:
typeOf
in interfaceLispObject
- Overrides:
typeOf
in classLispObject
-
classOf
public LispObject classOf()
- Overrides:
classOf
in classLispObject
-
typep
public LispObject typep(LispObject type)
- Overrides:
typep
in classLispObject
-
equalp
public boolean equalp(LispObject obj)
- Overrides:
equalp
in classLispObject
-
getParts
public LispObject 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
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:
printObject
in classLispObject
-
getTest
public Symbol getTest()
-
getEntry
protected HashTable.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
public LispObject ENTRIES()
-
getEntries
public LispObject getEntries()
- Specified by:
getEntries
in interfaceHashtable
-
MAPHASH
public LispObject MAPHASH(LispObject function)
-
psxhash
public int psxhash()
- Overrides:
psxhash
in classLispObject
-
-