|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgov.nih.nlm.nls.dbm.UncommonJDbm
UncommonJDbmDbm is an implementation of Russell Loane's newer Store package. It is a primitive file based store mechanism designed to be as fast as possible. This class includes methods that can handle WRITE_ONLY and READ_WRITE modes. Please note that any method that performs a write needs to be in a single threaded environment, or in an environment where only one thread has the handle to to the file during this task. This class does not include the syncronization gateways. It is up to those who use this class. Tue Dec 04 12:00:16 EST 2001, divita Initial Version
| Constructor Summary | |
UncommonJDbm(java.lang.String pFileName,
int pMode)
This is a constructor for StoreJDbm. |
|
| Method Summary | |
java.util.ArrayList |
beginsWith(java.lang.String pKey)
Method beginsWith [TBD] |
java.util.ArrayList |
beginsWithWord(java.lang.String pString)
Method beginsWithWord [TBD] |
void |
close()
Method close closes the db. |
java.util.Enumeration |
elements()
Method elements [TBD] |
int |
get(long pRowId)
Method get retrieves an int from the datastore using an int as the key This method returns a -1 if nothing was found. |
byte[] |
getBytes(int pRowId)
Method getBytes |
byte[] |
getBytes(java.lang.String pRowId)
Method getBytes |
int |
getInt(java.lang.String pKey)
Method getInt gets an int back from the datastore, using a string as the key This method will return -1 if nothing is found. |
int[] |
getInts(int pKey)
Method getInts retrieves an array of ints from the datastore using an int 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 |
int[] |
getNonUniqInts(java.lang.String pKey)
Method getNonUniqInts 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.Object |
getObject(int pRowId)
Method getObject |
java.lang.Object |
getObject(java.lang.String pRowId)
Method getObject |
java.lang.String |
getString(int pRowId)
Method getString retrieves UTF-8 Strings from the datastore using an int as the key |
java.lang.String |
getString(java.lang.String pKey)
Method getString retrieves from the datastore using a String as the key |
java.lang.String[] |
getStrings(java.lang.String pKey)
Method getStrings retrieves an array of Strings from the datastore using a string as the key |
java.util.Iterator |
keyIterator()
Method keyIterator [TBD] |
java.util.Enumeration |
keys()
Method keys [TBD] |
void |
open(java.lang.String pFileName)
Method open opens the database |
void |
put(int pKey,
int pValue)
Method put |
void |
put(java.lang.String pKey,
int pValue)
Method put |
void |
put(java.lang.String pKey,
java.lang.String pValue)
Method put |
void |
putAString(java.lang.String pKey,
java.lang.String pValue)
Method putAString |
void |
putBytes(int pKey,
byte[] pValue)
Method putBytes |
void |
putBytes(java.lang.String pKey,
byte[] pValue)
Method putBytes |
void |
putInts(int pKey,
int[] pValue)
Method putInts |
void |
putInts(java.lang.String pKey,
int[] pValue)
Method putInts |
void |
putNonUniqInts(java.lang.String pKey,
int pValue)
Method putNonUniqInts. |
void |
putObject(int pKey,
java.lang.Object pValue)
Method putObject |
void |
putObject(java.lang.String pKey,
java.lang.Object pValue)
Method putObject |
void |
putString(int pRowId,
java.lang.String pValue)
Method putString |
void |
putStrings(java.lang.String pKey,
java.lang.String[] pValue)
Method putStrings[] |
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 writes out the current state to disk. |
byte[] |
serializeObject(java.lang.Object pObject)
Method serializeObject |
void |
setDbType(int pDbType)
Method setDbType set's whether the index will be all loaded into memory, partially loaded into memory or will be all kept on disk. |
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 |
| Constructor Detail |
public UncommonJDbm(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 setDbType(int pDbType)
pDbType - SingleStoreFactory.kDiskLocation|kMixedLocation|kRAMLocation
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 putObject(java.lang.String pKey,
java.lang.Object pValue)
throws java.lang.Exception
putObject in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putBytes(java.lang.String pKey,
byte[] pValue)
throws java.lang.Exception
putBytes in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putBytes(int pKey,
byte[] pValue)
throws java.lang.Exception
putBytes in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void put(java.lang.String pKey,
java.lang.String pValue)
throws java.lang.Exception
put in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putObject(int pKey,
java.lang.Object pValue)
throws java.lang.Exception
putObject in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void put(int pKey,
int pValue)
throws java.lang.Exception
put in interface JDbmInterfacepKey - pValue -
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 putInts(int pKey,
int[] pValue)
throws java.lang.Exception
putInts in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putStrings(java.lang.String pKey,
java.lang.String[] pValue)
throws java.lang.Exception
putStrings in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putAString(java.lang.String pKey,
java.lang.String pValue)
throws java.lang.Exception
putAString in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putNonUniqInts(java.lang.String pKey,
int pValue)
throws java.lang.Exception
putNonUniqInts in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public void putString(int pRowId,
java.lang.String pValue)
throws java.lang.Exception
putString in interface JDbmInterfacepRowId - pValue -
java.lang.Exception
public void put(java.lang.String pKey,
int pValue)
throws java.lang.Exception
put in interface JDbmInterfacepKey - pValue -
java.lang.Exception
public java.lang.Object getObject(java.lang.String pRowId)
throws java.lang.Exception
getObject in interface JDbmInterfacepRowId -
java.lang.Exception
public byte[] getBytes(java.lang.String pRowId)
throws java.lang.Exception
getBytes in interface JDbmInterfacepRowId -
java.lang.Exception
public byte[] getBytes(int pRowId)
throws java.lang.Exception
getBytes in interface JDbmInterfacepRowId -
java.lang.Exception
public int getInt(java.lang.String pKey)
throws java.lang.Exception
getInt in interface JDbmInterfacepKey -
java.lang.Exception
public java.lang.Object getObject(int pRowId)
throws java.lang.Exception
getObject in interface JDbmInterfacepRowId -
java.lang.Exception
public int[] getInts(java.lang.String pKey)
throws java.lang.Exception
getInts in interface JDbmInterfacepKey -
java.lang.Exception
public int[] getInts(int pKey)
throws java.lang.Exception
getInts in interface JDbmInterfacepKey -
java.lang.Exception
public java.lang.String[] getStrings(java.lang.String pKey)
throws java.lang.Exception
getStrings in interface JDbmInterfacepKey -
java.lang.Exception
public int[] getNonUniqInts(java.lang.String pKey)
throws java.lang.Exception
getNonUniqInts in interface JDbmInterfacepKey -
java.lang.Exception
public int get(long pRowId)
throws java.lang.Exception
get in interface JDbmInterfacepRowId - ( (long) needs to be distinguished from the other get(int) signature)
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 java.util.Enumeration elements()
throws java.lang.Exception
elements in interface JDbmInterfacejava.lang.Exception
public java.util.Enumeration keys()
throws java.lang.Exception
keys in interface JDbmInterfacejava.lang.Exception
public java.util.Iterator keyIterator()
throws java.lang.Exception
keyIterator in interface JDbmInterfacejava.lang.Exceptionpublic long getNumberOfRecords()
getNumberOfRecords in interface JDbmInterfacepublic long getNumberOfStringKeyedRows()
getNumberOfStringKeyedRows in interface JDbmInterface
public java.util.ArrayList beginsWith(java.lang.String pKey)
throws java.lang.Exception
beginsWith in interface JDbmInterfacepKey -
java.lang.Exception
public java.util.ArrayList beginsWithWord(java.lang.String pString)
throws java.lang.Exception
beginsWithWord in interface JDbmInterfacepString -
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
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||