All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class store.DataStore

java.lang.Object
   |
   +----store.DataStore

public class DataStore
extends Object
implements Store
This class implements a Store for objects that implement the framework.Data interface. The Store uses a java.util.Vector to store the elements. Unlike other Stores, a DataStore can contain null-elements. Specific class of meant-to-be-generic class java.util.Vector. This class really should be a subclass of java.util.Vector, but most members of java.util.Vector are final.

Version:
$Revision: 1.2 $

Variable Index

 o list

Constructor Index

 o DataStore()

Method Index

 o add(Data)
 o add(StoreElement)
This Store should work on Data objects instead of StoreElements, but method add(StoreElement) is in the interface this class implements.
 o at(int)
 o Data()
 o elements()
This method is here because it is specified in the interface Store.
 o removeAll()
 o removeAt(int)
 o setElementAt(Data, int)
Sets the Data element at the specified index of this DataStore to be the specified Data object.
 o size()
 o toString()

Variables

 o list
 private Vector list

Constructors

 o DataStore
 public DataStore()

Methods

 o add
 public void add(Data d)
 o add
 public void add(StoreElement item)
This Store should work on Data objects instead of StoreElements, but method add(StoreElement) is in the interface this class implements.

 o setElementAt
 public void setElementAt(Data d,
                          int index) throws ArrayIndexOutOfBoundsException
Sets the Data element at the specified index of this DataStore to be the specified Data object. The previous Data element at that position is discarded.

The index must be a value greater than or equal to 0. It can be larger than the current size of the DataStore. In this case, the DataStore will be extended with null-elements to make it large enough to contain the Data element.

Parameters:
d - what the data element is to be set to.
index - the specified index.
Throws: ArrayIndexOutOfBoundsException
if the index was smaller than 0 .
See Also:
size
 o at
 public Data at(int index)
 o removeAt
 public void removeAt(int index)
 o removeAll
 public void removeAll()
 o size
 public int size()
 o Data
 public Enumeration Data()
 o elements
 public Enumeration elements()
This method is here because it is specified in the interface Store. Given that this store only works with Data objects, it makes more sense to name this method Data(). This method just refers to Data() for its result.

 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index