[armedbear-cvs] r12970 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Sun Oct 10 09:15:53 UTC 2010
Author: ehuelsmann
Date: Sun Oct 10 05:15:49 2010
New Revision: 12970
Log:
Remove Remove now obsolete hash table specializations;
in order to be able to instantiate HashTable directly
remove the 'abstract' modifier from the class; there are no
abstract methods anymore.
Removed:
trunk/abcl/src/org/armedbear/lisp/EqHashTable.java
trunk/abcl/src/org/armedbear/lisp/EqlHashTable.java
trunk/abcl/src/org/armedbear/lisp/EqualHashTable.java
trunk/abcl/src/org/armedbear/lisp/EqualpHashTable.java
Modified:
trunk/abcl/src/org/armedbear/lisp/HashTable.java
trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java
trunk/abcl/src/org/armedbear/lisp/Pathname.java
Modified: trunk/abcl/src/org/armedbear/lisp/HashTable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/HashTable.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/HashTable.java Sun Oct 10 05:15:49 2010
@@ -36,7 +36,7 @@
import java.util.concurrent.locks.ReentrantLock;
import static org.armedbear.lisp.Lisp.*;
-public abstract class HashTable extends LispObject {
+public class HashTable extends LispObject {
protected static final float loadFactor = 0.75f;
protected final LispObject rehashSize;
@@ -69,6 +69,26 @@
return capacity;
}
+ public static HashTable newEqHashTable(int size, LispObject rehashSize,
+ LispObject rehashThreshold) {
+ return new HashTable(new Comparator(), size, rehashSize, rehashThreshold);
+ }
+
+ public static HashTable newEqlHashTable(int size, LispObject rehashSize,
+ LispObject rehashThreshold) {
+ return new HashTable(new EqlComparator(), size, rehashSize, rehashThreshold);
+ }
+
+ public static HashTable newEqualHashTable(int size, LispObject rehashSize,
+ LispObject rehashThreshold) {
+ return new HashTable(new EqualComparator(), size, rehashSize, rehashThreshold);
+ }
+
+ public static LispObject newEqualpHashTable(int size, LispObject rehashSize,
+ LispObject rehashThreshold) {
+ return new HashTable(new EqualpComparator(), size, rehashSize, rehashThreshold);
+ }
+
public final LispObject getRehashSize() {
return rehashSize;
}
Modified: trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java Sun Oct 10 05:15:49 2010
@@ -57,13 +57,13 @@
{
final int n = Fixnum.getValue(size);
if (test == FUNCTION_EQL || test == NIL)
- return new EqlHashTable(n, rehashSize, rehashThreshold);
+ return HashTable.newEqlHashTable(n, rehashSize, rehashThreshold);
if (test == FUNCTION_EQ)
- return new EqHashTable(n, rehashSize, rehashThreshold);
+ return HashTable.newEqHashTable(n, rehashSize, rehashThreshold);
if (test == FUNCTION_EQUAL)
- return new EqualHashTable(n, rehashSize, rehashThreshold);
+ return HashTable.newEqualHashTable(n, rehashSize, rehashThreshold);
if (test == FUNCTION_EQUALP)
- return new EqualpHashTable(n, rehashSize, rehashThreshold);
+ return HashTable.newEqualpHashTable(n, rehashSize, rehashThreshold);
return error(new LispError("Unsupported test for MAKE-HASH-TABLE: " +
test.writeToString()));
}
Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java Sun Oct 10 05:15:49 2010
@@ -925,8 +925,8 @@
}
// A logical host is represented as the string that names it.
// (defvar *logical-pathname-translations* (make-hash-table :test 'equal))
- public static EqualHashTable LOGICAL_PATHNAME_TRANSLATIONS =
- new EqualHashTable(64, NIL, NIL);
+ public static HashTable LOGICAL_PATHNAME_TRANSLATIONS =
+ HashTable.newEqualHashTable(64, NIL, NIL);
private static final Symbol _LOGICAL_PATHNAME_TRANSLATIONS_ =
exportSpecial("*LOGICAL-PATHNAME-TRANSLATIONS*", PACKAGE_SYS,
LOGICAL_PATHNAME_TRANSLATIONS);
More information about the armedbear-cvs
mailing list