|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fatdog.xmlEngine.words.dictionaries.WordListHashtable
There be words here.
This class is derived originally from Hashtable. At present it's not a one-to-one replacement for it, but it's close.
12dec03: I've mutated IntList slightly by adding an IntList m_nextList field. This allows several ...XRef()-named methods here to use a linked- list structure to hold blocks of words having identical hashes and unique id's, with each word block holding the sequence of docId's the word occurs in.
NOTA: The way rehashing seems to work (looking at Sun code) is if m_count exceeds the threshold, where m_count is the total number of unique entries, not the number of buckets. Do we really want to rehash when this count is exceeded ????
Constructor Summary | |
WordListHashtable()
|
|
WordListHashtable(int initialCapacity)
|
|
WordListHashtable(int initialCapacity,
float loadFactor)
|
Method Summary | |
boolean |
containsKey(java.lang.String word)
|
boolean |
containsKey(java.lang.String word,
int[] hashId)
|
boolean |
containsWordXRefs(java.lang.String word,
int[] wordArgs)
We check whether the word's already been entered in the dictionary. |
void |
debugSummary()
|
int |
getKey(java.lang.String word)
|
boolean |
isEmpty()
|
void |
put(java.lang.String word,
int[] hashId)
|
void |
putWordXRef(java.lang.String word,
int[] wordArgs)
|
void |
putXRef(int[] wordArgs)
We know the word's already in the dictionary -- we need to find its linked list entry (looking thru the list for a matching id) and add the currDocId to the end of the entry |
int |
size()
|
java.lang.String |
wordFromKey(int key)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WordListHashtable(int initialCapacity, float loadFactor)
public WordListHashtable(int initialCapacity)
public WordListHashtable()
Method Detail |
public void put(java.lang.String word, int[] hashId)
public java.lang.String wordFromKey(int key)
public int getKey(java.lang.String word)
public boolean containsKey(java.lang.String word)
public void putWordXRef(java.lang.String word, int[] wordArgs)
public void putXRef(int[] wordArgs)
wordArgs
- [ key ][ hash ][ index ] [ currDocId ]public boolean containsWordXRefs(java.lang.String word, int[] wordArgs)
We also return its key if it exists, else -1. We also return its lastDocId entry, since we want to make sure the current doc has one and only one entry in the slot for this word 0 1 2 3 wordArgs entries are: [ key ][ hash ][ index ][ lastDoc ]
word
- the word being checked for existence in the dictionarywordArgs
- a 4-int array with contents as above
public boolean containsKey(java.lang.String word, int[] hashId)
public int size()
public boolean isEmpty()
public void debugSummary()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |