|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgov.nih.nlm.nls.dbm.InMemory
InMemory implements the interface to the dbm package Tue Dec 04 12:00:16 EST 2001, divita Initial Version
| Constructor Summary | |
InMemory()
This is a constructor for Inmemory |
|
InMemory(java.lang.String pFileName,
int pMode)
This is a constructor for InMemory |
|
| Method Summary | |
java.util.ArrayList |
beginsWith(java.lang.String pString)
Method beginsWith |
java.util.ArrayList |
beginsWithWord(java.lang.String pString)
Method beginsWithWord |
void |
close()
Method close |
java.util.Enumeration |
elements()
Method elements returns an Enumeration to traverse the data store. |
java.lang.Object |
get(int pRowId)
Method get retrieves an object from the datastore using a string as the key |
java.lang.Object |
get(java.lang.String pKey)
Method get gets an object back from the datastore, using a string as the key |
int[] |
getInts(java.lang.String pKey)
Method getInts retrieves an array of ints from the datastore using a string as the key |
long |
getNumberOfRecords()
Method getNumberOfRecords retrieves the number of records from the table that is keyed by a record id. |
long |
getNumberOfStringKeyedRows()
Method getNumberOfStringKeyedRows retrieves the number of rows in the table that contains strings as keys. |
java.lang.String |
getString(int pRowId)
Method getString retrieves Strings from the datastore using an int as the key |
java.lang.String |
getString(java.lang.String pKey)
Method getString retrieves UTF-8 Strings from the datastore using a String as the key |
java.util.Iterator |
keyIterator()
Method keyIterator returns the keys from this datastore This is not implementable in this package. |
java.util.Enumeration |
keys()
Method keys returns the keys from this datastore |
static void |
main(java.lang.String[] argv)
This is a test main, whose purpose is to test the functionality of each method developed for this class. |
void |
open(java.lang.String pFileName)
Method open |
void |
put(int pRowId,
java.lang.Object pValue)
Method put puts a serializable object into a datastore keyed by an int. |
int |
put(java.lang.Object pValue)
Method put puts a serializable object into a datastore keyed by an int. |
void |
put(java.lang.String pKey,
java.lang.Object pValue)
Method put puts a serializable object into a datastore, keyed by a string |
void |
put(java.lang.String pKey,
java.lang.String pValue)
Method put puts a String into a datastore keyed by a String. |
void |
putInts(java.lang.String pKey,
int[] pValue)
Method putInts puts an int[] into a datastore keyed by a string |
void |
putString(int pRowId,
java.lang.String pValue)
Method putString puts a String into a datastore keyed by an int. |
int |
putString(java.lang.String pValue)
Method putString puts a String into a datastore keyed by an int. |
void |
reorganize()
Method reorganize reorganizes the db into an optimized or balanced btree and does a save as a side effect. |
void |
save()
Method save |
byte[] |
serializeObject(java.lang.Object pObject)
Method serializeObject |
java.lang.Object |
unSerializeObject(byte[] pBytes)
Method unSerializeObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.nih.nlm.nls.dbm.JDbmInterface |
get, getBytes, getBytes, getInt, getInts, getNonUniqInts, getObject, getObject, getStrings, put, put, putAString, putBytes, putBytes, putInts, putNonUniqInts, putObject, putObject, putStrings |
| Constructor Detail |
public InMemory()
throws java.lang.Exception
java.lang.Exception
public InMemory(java.lang.String pFileName,
int pMode)
throws java.lang.Exception
pFileName - pMode - JDBM.WRITE_ONLY|JDBM.READ_WRITE|JDBM.READ_ONLY
java.lang.Exception| Method Detail |
public void open(java.lang.String pFileName)
throws java.lang.Exception
open in interface JDbmInterfacepFileName -
java.lang.Exception
public void close()
throws java.lang.Exception
close in interface JDbmInterfacejava.lang.Exception
public void save()
throws java.lang.Exception
save in interface JDbmInterfacejava.lang.Exception
public void reorganize()
throws java.lang.Exception
reorganize in interface JDbmInterfacejava.lang.Exception
public void put(java.lang.String pKey,
java.lang.Object pValue)
throws java.lang.Exception
pKey - pValue -
java.lang.Exception
public void put(int pRowId,
java.lang.Object pValue)
throws java.lang.Exception
pRowId - pValue -
java.lang.Exception
public int put(java.lang.Object pValue)
throws java.lang.Exception
pValue -
java.lang.Exception
public void put(java.lang.String pKey,
java.lang.String pValue)
throws java.lang.Exception
put in interface JDbmInterfacepKey - <------ it's got to be uniquepValue -
java.lang.Exception
public void putInts(java.lang.String pKey,
int[] pValue)
throws java.lang.Exception
putInts in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putString(int pRowId,
java.lang.String pValue)
throws java.lang.Exception
putString in interface JDbmInterfacepRowId - <---- it's got to be uniquepValue -
java.lang.Exception
public int putString(java.lang.String pValue)
throws java.lang.Exception
pValue -
java.lang.Exception
public java.lang.Object get(java.lang.String pKey)
throws java.lang.Exception
pKey -
java.lang.Exception
public java.lang.Object get(int pRowId)
throws java.lang.Exception
pRowId -
java.lang.Exception
public java.lang.String getString(int pRowId)
throws java.lang.Exception
getString in interface JDbmInterfacepRowId -
java.lang.Exception
public java.lang.String getString(java.lang.String pKey)
throws java.lang.Exception
getString in interface JDbmInterfacepKey -
java.lang.Exception
public int[] getInts(java.lang.String pKey)
throws java.lang.Exception
getInts in interface JDbmInterfacepKey -
java.lang.Exception
public byte[] serializeObject(java.lang.Object pObject)
throws java.lang.Exception
pObject -
java.lang.Exception
public java.lang.Object unSerializeObject(byte[] pBytes)
throws java.lang.Exception
pBytes -
java.lang.Exception
public java.util.Enumeration elements()
throws java.lang.Exception
elements in interface JDbmInterfacejava.lang.Exceptionpublic java.util.Enumeration keys()
keys in interface JDbmInterfacepublic java.util.Iterator keyIterator()
keyIterator in interface JDbmInterfacepublic java.util.ArrayList beginsWith(java.lang.String pString)
beginsWith in interface JDbmInterfacepString -
public java.util.ArrayList beginsWithWord(java.lang.String pString)
beginsWithWord in interface JDbmInterfacepString -
public long getNumberOfRecords()
getNumberOfRecords in interface JDbmInterfacepublic long getNumberOfStringKeyedRows()
getNumberOfStringKeyedRows in interface JDbmInterfacepublic static final void main(java.lang.String[] argv)
argv - The command line input, tokenized
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||