public class DBFDataStorage extends AbstractDataStorage implements AsciiSerializableConstants
| Modifier and Type | Class and Description |
|---|---|
static interface |
DBFDataStorage.DBFIterator<T> |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Double |
DBF_UNDEF_DOUBLE |
static java.lang.Double |
DBF_UNDEF_DOUBLE2 |
static java.lang.Float |
DBF_UNDEF_FLOAT |
static java.lang.Float |
DBF_UNDEF_FLOAT2 |
static java.lang.Integer |
DBF_UNDEF_INT |
static java.lang.Integer |
DBF_UNDEF_INT2 |
static java.lang.Long |
DBF_UNDEF_LONG |
static java.lang.Long |
DBF_UNDEF_LONG2 |
static boolean |
DEBUG |
ARRAY, BEGIN, BEGIN_ARRAY, BEGIN_COLLECTION, BEGIN_ENUM_TYPE, BEGIN_HASH, BEGIN_MAP, BEGIN_OBJECT, BEGIN_VECTOR, BOOLEAN, BOOLEAN_TYPE, BYTE, BYTE_TYPE, CHAR, CHAR_TYPE, CLASS, DELIM, DOUBLE, DOUBLE_TYPE, DSSFILEPATH, DSSPATH, END, END_ARRAY, END_COLLECTION, END_ENUM_TYPE, END_HASH, END_MAP, END_OBJECT, END_VECTOR, FIELD, FLOAT, FLOAT_TYPE, HEADER, ID, INT, INT_TYPE, LONG, LONG_TYPE, NAN, NEGATIVE_INFINITY, OLD_BEGIN, OLD_BEGIN_ARRAY, OLD_BEGIN_HASH, OLD_BEGIN_OBJECT, OLD_BEGIN_VECTOR, OLD_END, OLD_END_ARRAY, OLD_END_HASH, OLD_END_OBJECT, OLD_END_VECTOR, OLD_FIELD, OLD_REFERENCE, OLD_STRING, OLD_VALUE, POSITIVE_INFINITY, REFERENCE, SHORT, SHORT_TYPE, STRING, VALUE, VOID| Constructor and Description |
|---|
DBFDataStorage(hec.csinterface.RmiDataList parent,
java.lang.String clsType)
Constructor for the DBFDataStorage object.
|
DBFDataStorage(java.lang.String workspacePath,
java.lang.String clsType) |
DBFDataStorage(java.lang.String filePath,
java.lang.String clsType,
java.lang.String notUsed) |
| Modifier and Type | Method and Description |
|---|---|
long |
addNewObject(java.lang.Object obj)
Adds a new object to the end of the DBF file.
|
boolean |
appendData(java.lang.Object obj) |
boolean |
backupData(java.lang.String backupDir,
DataObject obj)
creats a backup of the dbf file
|
java.lang.Object |
callNativeMethod(java.lang.Object obj)
This method is overridden and returns null.
|
void |
compress()
This method is used to compress a datafile.
|
static codebase.Tag4info |
createTagInfo(DBFSerializable dbfObj) |
boolean |
doesExist(DBFSerializable dbfObj) |
boolean |
end() |
boolean |
findObject(java.lang.String tag,
java.lang.String key)
Finds an object in the database for the given tag and contains the given
key.
|
int |
getCurrentRowIndex() |
java.lang.Object[] |
getDataObjectIdList(java.lang.String objClass)
Returns a List of data objects that are in this storage
|
java.lang.String |
getFilename() |
java.lang.reflect.Method[] |
getMethodsByName(java.lang.String methodName)
return a list of methods that have the methodName
|
int |
getObjectCount() |
DataStruct[] |
getObjectList(java.lang.String objClass) |
boolean |
init()
initialize this DataStorage
|
boolean |
isInitialized() |
java.lang.Object |
loadCurrentObject() |
java.lang.Object |
loadObject(long id,
DBFSerializable dbfObj) |
java.lang.Object |
loadObject(long id,
java.lang.String objClass)
loads a record from the database into the given data object.
|
java.lang.Object |
loadObject(java.lang.String name,
java.lang.String objClass)
loads and object from the database based on the name of the object
|
<T> DBFDataStorage.DBFIterator<T> |
loadObjects(java.lang.String expression,
java.lang.Class<T> clazz)
Uses a DBF expression to load a set of objects.
|
void |
lockAddAll() |
static void |
main(java.lang.String[] args) |
void |
memoCompress() |
boolean |
nextRecord()
Moves to the next record in the database.
|
int |
numberRecords()
Calculates how many records are in the database
|
void |
pack() |
boolean |
previousRecord() |
void |
reindex() |
boolean |
removeObject(long[] objIds,
java.lang.String objClass) |
boolean |
removeObject(long objId,
java.lang.String objClass)
removes an object from the database.
|
boolean |
save()
Saves the currently loaded record to the database.
|
void |
setCheckForDifferences(boolean runCheck) |
void |
setInitialized(boolean b) |
boolean |
storeObject(java.lang.Object obj)
Stores an object to the database.
|
boolean |
top()
Moves to the top of the database
|
void |
unlock() |
void |
workspaceClosing() |
void |
writeCollection(java.util.Collection c)
Returns the milisecond time of the last time that the DBF File was
modified.
|
addNewObject2, getLastModifiedTime, reloadpublic static boolean DEBUG
public static final java.lang.Integer DBF_UNDEF_INT
public static final java.lang.Long DBF_UNDEF_LONG
public static final java.lang.Double DBF_UNDEF_DOUBLE
public static final java.lang.Float DBF_UNDEF_FLOAT
public static final java.lang.Integer DBF_UNDEF_INT2
public static final java.lang.Long DBF_UNDEF_LONG2
public static final java.lang.Double DBF_UNDEF_DOUBLE2
public static final java.lang.Float DBF_UNDEF_FLOAT2
public DBFDataStorage(java.lang.String workspacePath,
java.lang.String clsType)
public DBFDataStorage(hec.csinterface.RmiDataList parent,
java.lang.String clsType)
parent - The reference to the owner data list.public DBFDataStorage(java.lang.String filePath,
java.lang.String clsType,
java.lang.String notUsed)
public void setCheckForDifferences(boolean runCheck)
public int getCurrentRowIndex()
public static void main(java.lang.String[] args)
throws codebase.Error4unexpected,
codebase.Error4relateMatch
codebase.Error4unexpectedcodebase.Error4relateMatchpublic void setInitialized(boolean b)
public static codebase.Tag4info createTagInfo(DBFSerializable dbfObj) throws codebase.Error4usage
codebase.Error4usagepublic long addNewObject(java.lang.Object obj)
addNewObject in interface DataStorageaddNewObject in class AbstractDataStorageobj - The data object to add to the file
public boolean backupData(java.lang.String backupDir,
DataObject obj)
backupData in interface DataStoragebackupData in class AbstractDataStoragebackupDir - The backup directory to write toobj - public java.lang.Object callNativeMethod(java.lang.Object obj)
callNativeMethod in interface DataStoragecallNativeMethod in class AbstractDataStorageobj - The object that represents the native method to call
public java.lang.Object[] getDataObjectIdList(java.lang.String objClass)
getDataObjectIdList in interface DataStorageobjClass - The string representation of the object classpublic int getObjectCount()
getObjectCount in interface DataStoragegetObjectCount in class AbstractDataStoragepublic java.lang.reflect.Method[] getMethodsByName(java.lang.String methodName)
AbstractDataStoragepublic DataStruct[] getObjectList(java.lang.String objClass)
getObjectList in interface DataStorageobjClass - public void lockAddAll()
public void unlock()
public int numberRecords()
public boolean isInitialized()
public boolean init()
DataStorageinit in interface DataStoragepublic java.lang.Object loadObject(long id,
java.lang.String objClass)
loadObject in interface DataStorageid - The identifier of the record/object to loadobjClass - The class of the object to load
public java.lang.Object loadObject(long id,
DBFSerializable dbfObj)
public <T> DBFDataStorage.DBFIterator<T> loadObjects(java.lang.String expression, java.lang.Class<T> clazz)
expression - clazz - public java.lang.Object loadObject(java.lang.String name,
java.lang.String objClass)
loadObject in interface DataStorageloadObject in class AbstractDataStoragename - The name of the object to loadobjClass - the class of the object to load
public boolean findObject(java.lang.String tag,
java.lang.String key)
public boolean removeObject(long[] objIds,
java.lang.String objClass)
removeObject in interface DataStorageremoveObject in class AbstractDataStoragepublic void pack()
public void memoCompress()
public boolean removeObject(long objId,
java.lang.String objClass)
removeObject in interface DataStorageremoveObject in class AbstractDataStorageobjId - The object identifier of the object to removeobjClass - The class representation of the object to remove
public boolean save()
save in interface DataStoragesave in class AbstractDataStoragepublic boolean doesExist(DBFSerializable dbfObj)
public boolean storeObject(java.lang.Object obj)
storeObject in interface DataStoragepublic boolean appendData(java.lang.Object obj)
public void writeCollection(java.util.Collection c)
public void workspaceClosing()
workspaceClosing in interface DataStorageworkspaceClosing in class AbstractDataStoragepublic boolean nextRecord()
public boolean previousRecord()
public java.lang.Object loadCurrentObject()
public boolean top()
public boolean end()
public java.lang.String getFilename()
getFilename in interface DataStoragegetFilename in class AbstractDataStoragepublic void compress()
AbstractDataStoragecompress in interface DataStoragecompress in class AbstractDataStoragepublic void reindex()
throws java.io.IOException
java.io.IOException