ru.biosoft.access
Class FileEntryCollection2

java.lang.Object
  extended byru.biosoft.access.DataElementSupport
      extended byru.biosoft.access.AbstractDataCollection
          extended byru.biosoft.access.EntryCollection
              extended byru.biosoft.access.FileEntryCollection2
All Implemented Interfaces:
DataCollection, DataElement

public class FileEntryCollection2
extends EntryCollection

Version:
1.0
Author:
DevelopmentOnTheEdge
To do:
Document!!!, Algorithm for select index implementation.

Field Summary
static int BUFFER_SIZE
           
static int MAX_ENTRY_STR_SIZE
           
 
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
 
Fields inherited from interface ru.biosoft.access.DataCollection
CHILDREN_NODE_IMAGE, CHILDREN_NODE_VISIBLE, CLASS_PROPERTY, CLASSPATH_JAR_PROPERTY, COMPARATOR_OBJECT, CONFIG_FILE_PROPERTY, CONFIG_PATH_PROPERTY, DATA_ELEMENT_CLASS_PROPERTY, DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_SUFFIX, DEFAULT_FILTER_CONFIG_SUFFIX, DEFAULT_FORMAT_CONFIG_SUFFIX, DEFAULT_NODE_CONFIG_SUFFIX, DEFAULT_REPOSITORY, DESCRIPTION_PROPERTY, DISPLAY_NAME_PROPERTY, FILE_PATH_PROPERTY, FILE_PROPERTY, FILTER_PROPERTY, ID_FORMAT, IS_ROOT, JOB_CONTROL_PROPERTY, LATE_CHILDREN_INITIALIZATION, MUTABLE, NAME_PROPERTY, NEXT_CONFIG, NODE_IMAGE, NODE_VISIBLE, PRIMARY_COLLECTION, REMOVE_CHILDREN, TRANSFORMER_CLASS
 
Constructor Summary
FileEntryCollection2(DataCollection parent, java.util.Properties properties)
           
 
Method Summary
 void close()
          Close data collection.
 boolean contains(java.lang.String name)
          Returns true if this data collection contains the element with specified name.
protected  DataElement doGet(java.lang.String name)
          This method should be implemented in subclasses to get the specified data element from the collection.
protected  void doPut(DataElement element, boolean isNew)
          This method should be implemented in mutable subclasses to put the specified data element into the collection.
protected  void doRemove(java.lang.String name)
          This method should be implemented in mutable subclasses to remove the specified data element from the collection.
 java.util.List getInternalNameList()
           
 java.util.List getNameList()
          Gets list of all names in data collection.
 int getSize()
          Gets size of data collection.
 boolean isMutable()
          Determine is this collection mutable (writable).
 java.util.Iterator iterator()
          Returns an iterator over the data elements in this collection.
 
Methods inherited from class ru.biosoft.access.EntryCollection
getDataElementType
 
Methods inherited from class ru.biosoft.access.AbstractDataCollection
addDataCollectionListener, cachePut, checkMutable, contains, doAddPostNotify, doAddPreNotify, doRemovePostNotify, doRemovePreNotify, finalize, fireElementAdded, fireElementChanged, fireElementRemoved, fireElementWillAdd, fireElementWillChange, fireElementWillRemove, get, getCompleteName, getDescription, getInfo, initLog, isNotificationEnabled, isPropagationEnabled, makeInfo, propagateElementChanged, propagateElementWillChange, put, registerRoot, release, remove, removeDataCollectionListener, setNotificationEnabled, setPropagationEnabled, toString
 
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

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values
To do:
Document

MAX_ENTRY_STR_SIZE

public static final int MAX_ENTRY_STR_SIZE
See Also:
Constant Field Values
To do:
Document
Constructor Detail

FileEntryCollection2

public FileEntryCollection2(DataCollection parent,
                            java.util.Properties properties)
                     throws java.lang.Exception
To do:
Comment, Fill used files!!!
Method Detail

iterator

public java.util.Iterator iterator()
Description copied from interface: DataCollection
Returns an iterator over the data elements in this collection. There are no guarantees concerning the order in which the elements are returned. If the data collection is modified while an iteration over it is in progress, the results of the iteration are undefined.

To do:
Document

contains

public boolean contains(java.lang.String name)
Description copied from class: AbstractDataCollection
Returns true if this data collection contains the element with specified name.

Specified by:
contains in interface DataCollection
Overrides:
contains in class AbstractDataCollection
Parameters:
name - name of element whose presence in this data collection is to be tested.
Returns:
true if this data collection contains the element with specified name.
See Also:
AbstractDataCollection.contains(ru.biosoft.access.DataElement)
To do:
Document

getSize

public int getSize()
Description copied from class: AbstractDataCollection
Gets size of data collection. This method must be overrided for perfomance improving.

Specified by:
getSize in interface DataCollection
Overrides:
getSize in class AbstractDataCollection
Returns:
Number of data element in this data collection.
To do:
Document

getInternalNameList

public java.util.List getInternalNameList()

getNameList

public java.util.List getNameList()
Description copied from class: AbstractDataCollection
Gets list of all names in data collection.

Specified by:
getNameList in interface DataCollection
Overrides:
getNameList in class AbstractDataCollection
Returns:
Names of all elements in the data collection.

isMutable

public boolean isMutable()
Determine is this collection mutable (writable).

Specified by:
isMutable in interface DataCollection
Overrides:
isMutable in class AbstractDataCollection
Returns:
Always return TRUE.

close

public void close()
           throws java.lang.Exception
Close data collection. Release all resources (data file and index file). After call this method collection is invalid and any other methods may throw exceptions.

Specified by:
close in interface DataCollection
Overrides:
close in class AbstractDataCollection
Throws:
java.lang.Exception - If error occured.

doGet

protected DataElement doGet(java.lang.String name)
                     throws java.lang.Exception
Description copied from class: AbstractDataCollection
This method should be implemented in subclasses to get the specified data element from the collection. This implementation use iterator for finding needed data element.

Overrides:
doGet in class AbstractDataCollection
Parameters:
name - Name of needed data element.
Returns:
Data element or null if data element with specified name not found.
Throws:
java.lang.Exception
See Also:
AbstractDataCollection.get(String), DataCollection.iterator()
To do:
Document, high Optimize with other Entry constructor.

doPut

protected void doPut(DataElement element,
                     boolean isNew)
              throws java.lang.Exception
Description copied from class: AbstractDataCollection
This method should be implemented in mutable subclasses to put the specified data element into the collection.

Overrides:
doPut in class AbstractDataCollection
Throws:
java.lang.Exception
See Also:
AbstractDataCollection.put(DataElement)
To do:
Document

doRemove

protected void doRemove(java.lang.String name)
                 throws java.lang.Exception
Description copied from class: AbstractDataCollection
This method should be implemented in mutable subclasses to remove the specified data element from the collection.

Overrides:
doRemove in class AbstractDataCollection
Throws:
java.lang.Exception
See Also:
AbstractDataCollection.remove(String)
To do:
Document, do not write data to the file, only start shars,key,"delete",end chars, Rewrite (now this code pasted from old FileEntryCollection)


Copyright © 2001-2003 Biosof.Ru. All Rights Reserved.