|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.biosoft.access.DataElementSupport
ru.biosoft.access.AbstractDataCollection
ru.biosoft.access.EntryCollection
ru.biosoft.access.FileEntryCollection
Implements simple access procedures to databases in EMBL-like format.
| Field Summary | |
protected java.lang.String |
end
End tag of Entry. |
protected java.io.RandomAccessFile |
file
The data collection file. |
protected IndexTable |
idxTable
Indexes for entry searching by identificator (primary key). |
static int |
MAX_ENTRY_STR_LENGTH
If size of entry more than this constant then Entry store its data in file. |
protected java.util.List |
nameList
Unmodefiable list of names. |
static java.lang.String |
USE_INDEX_FILE
Property to indicate whether index file should be used (by default it is true). |
| Fields inherited from class ru.biosoft.access.EntryCollection |
ENTRY_DELIMITERS_PROPERTY, ENTRY_END_PROPERTY, ENTRY_ID_PROPERTY, ENTRY_START_PROPERTY |
| Fields inherited from class ru.biosoft.access.AbstractDataCollection |
cat, info, notificationEnabled, path, propagationEnabled, v_cache |
| Constructor Summary | |
FileEntryCollection(DataCollection parent,
java.util.Properties properties)
Loads the data collection and its indexes (currently only for id). |
|
| Method Summary | |
void |
close()
Closes data collection, releases all resources. |
boolean |
contains(java.lang.String name)
Check is file entry collection contains data element with specified name. |
protected DataElement |
doGet(java.lang.String name)
Read entry with specified name from file. |
protected void |
doPut(DataElement element,
boolean isNew)
Write entry into the file. |
protected void |
doRemove(java.lang.String name)
Remove entry from the data collection. |
java.util.List |
getNameList()
Gets list of all names in data collection. |
int |
getSize()
Return size of data collection. |
boolean |
isMutable()
Determine is this collection mutable (writable). |
java.util.Iterator |
iterator()
Return iterator for data collection. |
| Methods inherited from class ru.biosoft.access.EntryCollection |
getDataElementType |
| Methods inherited from class ru.biosoft.access.DataElementSupport |
getName, getOrigin, registerConstructorWithBadEqual |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ru.biosoft.access.DataElement |
getName, getOrigin |
| Field Detail |
public static final java.lang.String USE_INDEX_FILE
public static final int MAX_ENTRY_STR_LENGTH
protected java.io.RandomAccessFile file
protected IndexTable idxTable
IndexTableprotected java.util.List nameList
protected java.lang.String end
| Constructor Detail |
public FileEntryCollection(DataCollection parent,
java.util.Properties properties)
throws java.lang.Exception
CollectionFactory
parent - Parent data collection.properties - Properties for creating FileEntryCollection
java.lang.ExceptionCollectionFactory| Method Detail |
protected DataElement doGet(java.lang.String name)
throws java.lang.Exception
doGet in class AbstractDataCollectionname - Name (PK) of the data element that should be extract from data collection.
java.lang.ExceptionAbstractDataCollection.get(String)
protected void doPut(DataElement element,
boolean isNew)
throws java.lang.Exception
doPut in class AbstractDataCollectionelement - Element that should be added into collection.
java.lang.Exception - If data element cann't be added.AbstractDataCollection.put(DataElement),
IndexTable.put(java.io.RandomAccessFile,String)
protected void doRemove(java.lang.String name)
throws java.lang.Exception
doRemove in class AbstractDataCollectionjava.io.IOException - If data element cann't be removed.
java.lang.ExceptionAbstractDataCollection.remove(String),
IndexTable.removeIndex(String)public int getSize()
getSize in interface DataCollectiongetSize in class AbstractDataCollectionpublic boolean isMutable()
isMutable in interface DataCollectionisMutable in class AbstractDataCollectionpublic boolean contains(java.lang.String name)
contains in interface DataCollectioncontains in class AbstractDataCollectionname - Name of data element.
true - if contains, false otherwise.AbstractDataCollection.contains(ru.biosoft.access.DataElement)public java.util.Iterator iterator()
public java.util.List getNameList()
AbstractDataCollection
getNameList in interface DataCollectiongetNameList in class AbstractDataCollection
public void close()
throws java.lang.Exception
close in interface DataCollectionclose in class AbstractDataCollectionjava.io.IOException - When io error occured.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||