public class HDataBase extends Object
Modifier and Type | Field and Description |
---|---|
RecordsFile |
recordsFile |
RecordReader |
rr |
RecordWriter |
rw |
Constructor and Description |
---|
HDataBase(String file)
Open the database file for reading.
|
HDataBase(String file,
String option)
Create a new persistent database.
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Close the file
|
Object |
get(String key)
Get object from the database using a key
|
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(String key,
Object obj)
Insert an object with a key
|
boolean |
isExists(String key)
Checks if there is a record belonging to the given key.
|
boolean |
remove(String key)
Remove object from the database using the key
|
boolean |
update(Object ob,
String key)
Update the database with a new value
|
public RecordsFile recordsFile
public RecordWriter rw
public RecordReader rr
public HDataBase(String file, 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(String file)
file
- File namepublic Enumeration getKeys()
public int getRecords()
public boolean isExists(String key)
public boolean insert(String key, Object obj)
key
- key for objectobj
- Object for this keypublic Object get(String key)
key
- Key to get the objectpublic boolean update(Object ob, String key)
ob
- Objectkey
- keypublic boolean remove(String key)
key
- input keypublic boolean close()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics