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 $
-
list
-
-
DataStore()
-
-
add(Data)
-
-
add(StoreElement)
- This Store should work on Data objects instead of StoreElements, but
method add(StoreElement) is in the interface this class implements.
-
at(int)
-
-
Data()
-
-
elements()
- This method is here because it is specified in the interface Store.
-
removeAll()
-
-
removeAt(int)
-
-
setElementAt(Data, int)
- Sets the Data element at the specified
index
of this
DataStore to be the specified Data object.
-
size()
-
-
toString()
-
list
private Vector list
DataStore
public DataStore()
add
public void add(Data d)
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.
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
at
public Data at(int index)
removeAt
public void removeAt(int index)
removeAll
public void removeAll()
size
public int size()
Data
public Enumeration Data()
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.
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index