HEADER

ru.biosoft.access
Class VectorDataCollection

ru.biosoft.access.DataElementSupport
  |
  +--ru.biosoft.access.AbstractDataCollection
        |
        +--ru.biosoft.access.VectorDataCollection
Direct Known Subclasses:
SbwModule, SbwService, SbwServiceCategory, DataCollectionUnion2, FileCollection, LocalRepository, HostObjectInfo, Plugins

public class VectorDataCollection
extends AbstractDataCollection

DataCollection based on Vector ( DataElement's is stored in Vector ).


Field Summary
 final static intINITIAL_SIZE
          Initial capacity of this collection.

Constructor Summary
VectorDataCollection(DataCollection parent, Properties properties)
          Constructor to be used by CollectionFactory to create VectorDataCollection.
VectorDataCollection(String name, DataCollection parent, Properties properties)
          Constructs data collection with specified name and parent.

Method Summary
 voidclose()
          Removes all of the elements from this data collection.
 DataElementgetAt(int index)
          Returns the element at the specified position in this data collection.
 ListgetNameList()
          Returns an unmodifiable list of the data element names contained in this data collection.
 intgetSize()
          Returns the number of data elements in this data collection.
 Iteratoriterator()
          Returns an iterator over the elements in this list in alphabetically sorted sequence.
 DataElementput(DataElement element)
          Add the specified element to this data collection.
 Object[]toArray(Object[] a)
          Returns an array containing all of the elements in this VectorDataCollection in the correct order; the runtime type of the returned array is that of the specified array.

Methods inherited from class ru.biosoft.access.AbstractDataCollection
addDataCollectionListener, contains, contains, get, getCompleteName, getDataElementType, getDescription, getInfo, isMutable, isNotificationEnabled, isPropagationEnabled, propagateElementChanged, propagateElementWillChange, release, remove, removeDataCollectionListener, setNotificationEnabled, setPropagationEnabled, toString

Methods inherited from class ru.biosoft.access.DataElementSupport
getName, getOrigin, registerConstructorWithBadEqual

Field Detail

INITIAL_SIZE

public final static int INITIAL_SIZE
Initial capacity of this collection.
Constructor Detail

VectorDataCollection

public VectorDataCollection(DataCollection parent, Properties properties)
Constructor to be used by CollectionFactory to create VectorDataCollection.
Parameters:
parent - parent DataCollection
properties - set of properties

VectorDataCollection

public VectorDataCollection(String name, DataCollection parent, Properties properties)
Constructs data collection with specified name and parent.
Parameters:
parent - Parent for this data collection.
parent - name of this data collection.
properties - Properties to initialise DataCollectionInfo. Can be null.
Method Detail

close

public void close()
throws java.lang.Exception
Removes all of the elements from this data collection.
Throws:
Never - throws any exception.

getAt

public DataElement getAt(int index)
Returns the element at the specified position in this data collection.
Parameters:
index - index of element to return.
Returns: the element at the specified position in this data collection.
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getSize()).

getNameList

public List getNameList()
Returns an unmodifiable list of the data element names contained in this data collection. Query operations on the returned list "read through" to the internal name list, and attempts to modify the returned list, whether direct or via its iterator, result in an UnsupportedOperationException. The returned list is backed by the data collection, so changes to the data collection are reflected in the returned list.
Returns: Names of all elements in this data collection in alphabetically sorted order.

getSize

public int getSize()
Returns the number of data elements in this data collection.
Returns: the number of data elements in this data collection.

iterator

public Iterator iterator()
Returns an iterator over the elements in this list in alphabetically sorted sequence.
Returns: an iterator over the elements in this list in alphabetically sorted sequence.

put

public DataElement put(DataElement element)
throws java.lang.Exception
Add the specified element to this data collection. Fire pre/post notify events.
Parameters:
element - element to be added to this data collection.
Returns: the previous data element with same name, or null if it did not have one.
Throws:
IllegalArgumentException - if dataElement is null.
Exception - If any error occurs.
See Also:
AbstractDataCollection.put(ru.biosoft.access.DataElement)

toArray

public Object[] toArray(Object[] a)
Returns an array containing all of the elements in this VectorDataCollection in the correct order; the runtime type of the returned array is that of the specified array.
See Also:
Vector.toArray(Object[]

Association Links

to Class java.util.Vector

Back-end storage for data elements.

to Class java.util.List

Name list of this data collection.

FOOTER

BOTTOM