public class FileHashtable
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowCompress |
protected java.util.ArrayList |
deadPartitionList |
protected Factory |
keyFactory |
protected ObjectStorageFile |
objStorage |
protected java.util.HashMap |
objStorageList |
protected java.util.HashMap |
offsetTable |
| Constructor and Description |
|---|
FileHashtable(java.util.ArrayList storageFileList,
Factory keyFact) |
FileHashtable(ObjectStorageFile storage,
Factory keyFact)
Create a new file-based table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPartition(ObjectStorageFile newStorage,
int index) |
void |
clear()
This method is not supported.
|
void |
close()
Closes the file table.
|
void |
compressTable()
Compresses the ObjectStorageFile's file, and resets the offset
table.
|
boolean |
containsKey(java.lang.Object key)
Returns whether this table contains the given key.
|
boolean |
containsValue(java.lang.Object value)
Returns whether this table contains the given value.
|
java.util.Set |
entrySet()
Returns the entries in Map.Entry form.
|
boolean |
equals(java.lang.Object o)
Returns whether this table is equal to the given Object.
|
java.lang.Object |
get(java.lang.Object key)
Retrieve an Object with the given key.
|
int |
hashCode()
Returns the hash code for this table.
|
boolean |
isEmpty()
Returns whether the table is empty.
|
java.util.Enumeration |
keys()
Returns the keys of the table.
|
java.util.Set |
keySet()
Returns the keys of this table as a Set interface.
|
void |
open()
Opens the file table.
|
void |
pauseTableCompression()
Pause the table compression.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts an Object value in the table using the Object key.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
int index) |
void |
putAll(java.util.Map t)
Puts all of the elements of the given Map into this table.
|
java.lang.Object |
remove(java.lang.Object key)
Removes an Object from the table.
|
protected void |
removeDeadPartitions() |
java.lang.Object |
removeDelayedNARParsing(java.lang.Object key)
This method is for exclusive use by MTAggrDispatcher ONLY, because this method must
return NAR instead of an arbitrary Object.
|
void |
resumeTableCompression()
Compresses the ObjectStorageFile's file, and resets the offset
table.
|
int |
size()
Returns the number of Objects in the table.
|
java.lang.String |
toString()
Returns the table, in displayable format.
|
java.util.Collection |
values()
Returns all the values in the table as a Collection interface.
|
protected java.util.HashMap offsetTable
protected ObjectStorageFile objStorage
protected java.util.HashMap objStorageList
protected java.util.ArrayList deadPartitionList
protected Factory keyFactory
protected boolean allowCompress
public FileHashtable(ObjectStorageFile storage, Factory keyFact) throws java.io.IOException
storage - Handles the actual Object storage to disk.keyFact - Factory class, used to build Object keys
when using a previously created table.java.io.IOExceptionpublic FileHashtable(java.util.ArrayList storageFileList,
Factory keyFact)
throws java.io.IOException
java.io.IOExceptionpublic void addPartition(ObjectStorageFile newStorage, int index) throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object get(java.lang.Object key)
throws java.io.IOException
key - Object key to retrieve the value with.java.io.IOExceptionpublic java.lang.Object put(java.lang.Object key,
java.lang.Object value,
int index)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object put(java.lang.Object key,
java.lang.Object value)
throws java.io.IOException
key - Key to index into the table.value - Value to put in the table.java.io.IOExceptionpublic void pauseTableCompression()
public java.lang.Object remove(java.lang.Object key)
throws java.io.IOException
key - Object key, used to find the Object in the table.java.io.IOExceptionpublic java.lang.Object removeDelayedNARParsing(java.lang.Object key)
throws java.io.IOException
key - java.io.IOExceptionprotected void removeDeadPartitions()
throws java.io.IOException
java.io.IOExceptionpublic void resumeTableCompression()
throws java.io.IOException
java.io.IOExceptionpublic void compressTable()
throws java.lang.NullPointerException,
java.io.IOException
java.lang.NullPointerExceptionjava.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic void open()
throws java.io.IOException
java.io.IOExceptionpublic void clear()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationExceptionpublic boolean containsKey(java.lang.Object key)
key - Key to find.public boolean containsValue(java.lang.Object value)
throws java.io.IOException
value - Value to find.java.io.IOExceptionpublic java.util.Set keySet()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationExceptionpublic int size()
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Set entrySet()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - Object to test for equalitypublic int hashCode()
throws java.lang.UnsupportedOperationException
hashCode in class java.lang.Objectjava.lang.UnsupportedOperationExceptionpublic void putAll(java.util.Map t)
throws java.lang.UnsupportedOperationException
t - holds elements to enter into this tablejava.lang.UnsupportedOperationExceptionpublic java.util.Collection values()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationExceptionpublic java.util.Enumeration keys()