javax.rad.model
Interface IDataPage

All Known Subinterfaces:
IDataBook
All Known Implementing Classes:
MemDataBook, MemDataPage, RemoteDataBook, RemoteDataPage, StorageDataBook

public interface IDataPage

The IDataPage is the abstract representation of multiple IDataRows, basically mimicking one set of rows or a result set.

The IDataPage is part of the of the IDataBook, as it can have multiple IDataPages. A IDataRow can also have a master IDataRow which it is associated with.

See Also:
IDataRow, IDataBook, IChangeableDataRow

Method Summary
 void fetchAll()
          Fetches all IDataRows from the storage.
 int[] getChangedDataRows()
          Deprecated. since 2.5, use getChangedRows() instead.
 int[] getChangedRows()
          Gets an int array containing the indexes of all changed IDataRow s.
 IDataBook getDataBook()
          Gets the parent IDataBook.
 IChangeableDataRow getDataRow(int pDataRowIndex)
          Gets a copy of the IChangeableDataRow at the specified index.
 IDataRow getMasterDataRow()
          Gets the corresponding master row.
 int getRowCount()
          Gets the number of rows which are currently held.
 boolean isAllFetched()
          Gets if all IDataRows have been fetched from the storage, and there is nothing more to fetch.
 int searchNext(ICondition pCondition)
          Searches for the first occurrence of an IDataRow which matches the given ICondition and returns its index.
 int searchNext(ICondition pCondition, int pStartIndex)
          Searches for the next occurrence of an IDataRow which matches the given ICondition and returns its index.
 int searchPrevious(ICondition pCondition)
          Searches for the last occurrence of an IDataRow which matches the given ICondition and returns its index.
 int searchPrevious(ICondition pCondition, int pStartIndex)
          Searches for the previous occurrence of an IDataRow which matches the given ICondition and returns its index.
 

Method Detail

getDataBook

IDataBook getDataBook()
Gets the parent IDataBook.

Returns:
Gets the parent IDataBook.

getMasterDataRow

IDataRow getMasterDataRow()
                          throws ModelException
Gets the corresponding master row.

Returns:
the corresponding master row.
Throws:
ModelException - if the master row could not be fetched for some reason.

getDataRow

IChangeableDataRow getDataRow(int pDataRowIndex)
                              throws ModelException
Gets a copy of the IChangeableDataRow at the specified index. Returns null if there is no row at the specified index.

If the row is currently not in memory, it will be fetched from the underlying storage.

Parameters:
pDataRowIndex - the index of the IChangeableDataRow to get.
Returns:
a copy of the IChangeableDataRow at the specified index, null if there is no row at the specified index.
Throws:
ModelException - if the IChangeableDataRow at the specified index can no be got.

getRowCount

int getRowCount()
                throws ModelException
Gets the number of rows which are currently held.

Returns:
the number of rows which are currently held.
Throws:
ModelException - if the number of rows could not be determined.

fetchAll

void fetchAll()
              throws ModelException
Fetches all IDataRows from the storage.

Throws:
ModelException - if there is a problem while fetching the rows.

isAllFetched

boolean isAllFetched()
                     throws ModelException
Gets if all IDataRows have been fetched from the storage, and there is nothing more to fetch.

Returns:
true if all IDataRows have been fetched.
Throws:
ModelException - if determining if all IDataRows have been fetched failed.

getChangedDataRows

@Deprecated
int[] getChangedDataRows()
                         throws ModelException
Deprecated. since 2.5, use getChangedRows() instead.

Gets an int array containing the indexes of all changed IDataRow s. Returns an empty array if there are no changed IDataRows.

Returns:
an int array containing the indexes of all changed IDataRows. An empty array if there are no changes.
Throws:
ModelException - if a exception occurs during synchronize.

getChangedRows

int[] getChangedRows()
                     throws ModelException
Gets an int array containing the indexes of all changed IDataRow s. Returns an empty array if there are no changed IDataRows.

Returns:
an int array containing the indexes of all changed IDataRows. An empty array if there are no changes.
Throws:
ModelException - if a exception occurs during synchronize.

searchNext

int searchNext(ICondition pCondition)
               throws ModelException
Searches for the first occurrence of an IDataRow which matches the given ICondition and returns its index. -1 is returned if there is no IDataRow that matches.

This method might fetch more rows from the storage as needed.

Parameters:
pCondition - the ICondition.
Returns:
the index of the first matching IDataRow, -1 if there is none.
Throws:
ModelException - if searching through and/or fetching the IDataRows failed.

searchNext

int searchNext(ICondition pCondition,
               int pStartIndex)
               throws ModelException
Searches for the next occurrence of an IDataRow which matches the given ICondition and returns its index. The search is started at the given index. -1 is returned if there is no IDataRow that matches.

This method might fetch more rows from the storage as needed.

Parameters:
pCondition - the ICondition.
pStartIndex - the index at which to start, inclusive.
Returns:
the index of the next matching IDataRow, -1 if there is none.
Throws:
ModelException - if searching through and/or fetching the IDataRows failed.

searchPrevious

int searchPrevious(ICondition pCondition)
                   throws ModelException
Searches for the last occurrence of an IDataRow which matches the given ICondition and returns its index. -1 is returned if there is no IDataRow that matches.

This method might fetch more rows from the storage as needed.

Parameters:
pCondition - the ICondition.
Returns:
the index of the last matching IDataRow, -1 if there is none.
Throws:
ModelException - if searching through and/or fetching the IDataRows failed.

searchPrevious

int searchPrevious(ICondition pCondition,
                   int pStartIndex)
                   throws ModelException
Searches for the previous occurrence of an IDataRow which matches the given ICondition and returns its index. The search is started at the given index. -1 is returned if there is no IDataRow that matches.

This method might fetch more rows from the storage as needed.

Parameters:
pCondition - the ICondition.
pStartIndex - the index at which to start, exclusive.
Returns:
the index of the previous matching IDataRow, -1 if there is none.
Throws:
ModelException - if searching through and/or fetching the IDataRows failed.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.