public class HDataBase
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
RecordsFile |
recordsFile |
RecordReader |
rr |
RecordWriter |
rw |
Constructor and Description |
---|
HDataBase(java.lang.String file)
Open the database file for reading.
|
HDataBase(java.lang.String file,
java.lang.String option)
Create a new persistent database.
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Close the file
|
java.lang.Object |
get(java.lang.String key)
Get object from the database using a key
|
java.util.Enumeration |
getKeys()
Returns an enumeration of all the keys in the database.
|
int |
getRecords()
Returns the current number of records in the database.
|
boolean |
insert(java.lang.String key,
java.lang.Object obj)
Insert an object with a key
|
boolean |
isExists(java.lang.String key)
Checks if there is a record belonging to the given key.
|
boolean |
remove(java.lang.String key)
Remove object from the database using the key
|
boolean |
update(java.lang.Object ob,
java.lang.String key)
Update the database with a new value
|
public RecordsFile recordsFile
public RecordWriter rw
public RecordReader rr
public HDataBase(java.lang.String file, java.lang.String option)
file
- File nameoption
- Option to create the file . If "w" - write a file (or read)
file, if "r" only read created file.public HDataBase(java.lang.String file)
file
- File namepublic java.util.Enumeration getKeys()
public int getRecords()
public boolean isExists(java.lang.String key)
public boolean insert(java.lang.String key, java.lang.Object obj)
key
- key for objectobj
- Object for this keypublic java.lang.Object get(java.lang.String key)
key
- Key to get the objectpublic boolean update(java.lang.Object ob, java.lang.String key)
ob
- Objectkey
- keypublic boolean remove(java.lang.String key)
key
- input keypublic boolean close()
JHepSim. A part of HSTOOLS. version-1.2