You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/09/12 00:26:09 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/utils SymbolTable.java SymbolHasher.java
andyc 00/09/11 15:26:07
Modified: java/src/org/apache/xerces/utils Tag: xerces_j_2
SymbolTable.java
Removed: java/src/org/apache/xerces/utils Tag: xerces_j_2
SymbolHasher.java
Log:
Finished merging of SymbolHasher interface into SymbolTable.
Revision Changes Path
No revision
No revision
1.1.2.6 +4 -29 xml-xerces/java/src/org/apache/xerces/utils/Attic/SymbolTable.java
Index: SymbolTable.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/utils/Attic/SymbolTable.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- SymbolTable.java 2000/09/11 21:56:53 1.1.2.5
+++ SymbolTable.java 2000/09/11 22:26:05 1.1.2.6
@@ -85,7 +85,7 @@
* @author Stubs generated by DesignDoc on Wed Jun 07 11:58:44 PDT 2000
* @author Andy Clark
*
- * @version $Id: SymbolTable.java,v 1.1.2.5 2000/09/11 21:56:53 andyc Exp $
+ * @version $Id: SymbolTable.java,v 1.1.2.6 2000/09/11 22:26:05 andyc Exp $
*/
public class SymbolTable {
@@ -100,9 +100,6 @@
// Data
//
- /** Symbol hasher. */
- protected SymbolHasher fSymbolHasher;
-
/** Buckets. */
protected Entry[] fBuckets = new Entry[TABLE_SIZE];
@@ -110,21 +107,8 @@
// Constructors
//
- /**
- * Constructs a symbol table that uses the default hashing
- * algorithm.
- */
+ /** Constructs a symbol table. */
public SymbolTable() {
- this(new Hasher());
- }
-
- /**
- * Constructs a symbol table with the specified symbol hasher.
- *
- * @param symbolHasher The symbol hasher to use.
- */
- public SymbolTable(SymbolHasher symbolHasher) {
- fSymbolHasher = symbolHasher;
}
//
@@ -132,15 +116,6 @@
//
/**
- * getSymbolHasher
- *
- * @return
- */
- public SymbolHasher getSymbolHasher() {
- return fSymbolHasher;
- }
-
- /**
* addSymbol
*
* @param symbol
@@ -150,7 +125,7 @@
public String addSymbol(String symbol) {
// search for identical symbol
- int bucket = fSymbolHasher.hash(symbol) % TABLE_SIZE;
+ int bucket = hash(symbol) % TABLE_SIZE;
OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
int length = symbol.length();
if (length == entry.characters.length) {
@@ -182,7 +157,7 @@
public String addSymbol(char[] buffer, int offset, int length) {
// search for identical symbol
- int bucket = fSymbolHasher.hash(buffer, offset, length) % TABLE_SIZE;
+ int bucket = hash(buffer, offset, length) % TABLE_SIZE;
OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
if (length == entry.characters.length) {
for (int i = 0; i < length; i++) {