com.iplanet.jato.model
Interface DatasetModel

All Superinterfaces:
Model
All Known Subinterfaces:
RetrievingDatasetModel, SelectQueryModel
All Known Implementing Classes:
BeanAdapterModel, DefaultModel

public interface DatasetModel
extends Model

This specialization of Model declares methods necessary to allow generic manipulation of a dataset model. A dataset model is a model that supports multiple discreet sets of data, such as records, database rows, or a list of business object with specific properties.

Version:
JATO/1.2.2 $Id: DatasetModel.java,v 1.7 2002/03/16 03:26:30 todd Exp $

Method Summary
 void beforeFirst()
          Moves the internal location iterator to a special position such that a call to next() will position the location at the first dataset (if available).
 boolean first()
          Moves the internal location iterator to the first available dataset.
 int getLocation()
          Get the relative location of the current data within the dataset.
 int getLocationOffset()
          Returns the offset of this dataset from some implementation- or context-dependent reference location.
 int getSize()
          Return the number of available datasets.
 boolean last()
          Moves the internal location iterator to the last available dataset.
 boolean next()
          Moves the internal location iterator to the next available dataset
 boolean previous()
          Moves the internal location iterator to the previous available dataset
 void setLocation(int location)
          Set the relative location of the current dataset.
 void setSize(int value)
          Sets the number of available datasets.
 
Methods inherited from interface com.iplanet.jato.model.Model
getName, getValue, getValues, setName, setValue, setValues
 

Method Detail

getSize

public int getSize()
            throws ModelControlException
Return the number of available datasets. This value may be fixed or change over time depending on the implementation. In most cases, this value will remain fixed for each data retrieval operation ("execution").
Returns:
The number of available datasets
Throws:
ModelControlException - Thrown if an error occurrs determining the number of datasets

setSize

public void setSize(int value)
             throws ModelControlException
Sets the number of available datasets. Setting the number of datasets may not be supported by all model control implementations.
Throws:
ModelControlException - Thrown if an error occurrs setting the number of datasets. Not all model control implementations will allow the number of datasets to be directly changed.

getLocationOffset

public int getLocationOffset()
                      throws ModelControlException
Returns the offset of this dataset from some implementation- or context-dependent reference location. In most cases, this value will indicate the absolute offset from this reference. Such information may be useful in some classes of manipulation of dataset models. For example, this value could indicate the offset of the current "window" within a query result set, so that that absolute location could be located again later. Note that this control object is under no obligation or burden to allow setting the location to obtain datasets outside of the current window defined by the boundaries of the first() and last() locations--this information is informational only.
Throws:
ModelControlException - Thrown if an error occurrs determining the location offset, or if the notion of location offset is not supported. However, if the latter is the case, implementors are encouraged instead to return a value indicating the situation, such as zero or negative one (0 or -1).

getLocation

public int getLocation()
                throws ModelControlException
Get the relative location of the current data within the dataset. This method should normally return zero after the first() method is called. In addition, this method will typically return negative one (-1) after the beforeFirst() method is called.
Throws:
ModelControlException - Thrown if an error occurrs determining the current location, or if the current location is undefined. However, if the latter is the case, implementors are encouraged instead to return a value indicating this situation, like negative one (-1).

setLocation

public void setLocation(int location)
                 throws ModelControlException
Set the relative location of the current dataset. A call to this method with a parameter of zero (0) should be equivalent to calling the first() method. Normally, a call to this method with a parameter of negative one (-1) should be equivalent to calling the beforeFirst() method. However, neither of these situations are guaranteed depending on the implementation.
Throws:
ModelControlException - Thrown if an error occurrs setting the current location. Not all model control implementations support setting the current location.

beforeFirst

public void beforeFirst()
                 throws ModelControlException
Moves the internal location iterator to a special position such that a call to next() will position the location at the first dataset (if available). Normally, a call to getLocation() after this method is called should return negative one (-1).
Throws:
ModelControlException - Thrown if an error occurrs setting the location to this special position

first

public boolean first()
              throws ModelControlException
Moves the internal location iterator to the first available dataset. Normally, a call to getLocation() after this method is called should return zero (0). The offset of this dataset from some implementation- or context-dependent reference location is given by getLocationOffset(). However, this control object is under no obligation or burden to allow setting the location to obtain datasets outside of the "window" defined by the boundaries of the first() and last() locations.
Returns:
True if now positioned at a valid dataset, false if there is no available dataset
Throws:
ModelControlException - Thrown if an error occurrs moving to the first dataset

next

public boolean next()
             throws ModelControlException
Moves the internal location iterator to the next available dataset
Returns:
True if now positioned at a valid dataset, false if there are no more datasets
Throws:
ModelControlException - Thrown if an error occurrs positioning at the next dataset

previous

public boolean previous()
                 throws ModelControlException
Moves the internal location iterator to the previous available dataset
Returns:
True if now positioned at a valid dataset, false if there are no more datasets
Throws:
ModelControlException - Thrown if an error occurrs positioning at the previous dataset

last

public boolean last()
             throws ModelControlException
Moves the internal location iterator to the last available dataset. Normally, a call to getLocation() after this method is called should return getSize()-1.
Returns:
True if now positioned at a valid dataset, false if there is no available dataset
Throws:
ModelControlException - Thrown if an error occurrs moving to the last dataset