public abstract class RandomAccessDataRecordSource extends DataRecordSource
Provides a basic implementation of fetchImp() that keeps track of a recordCount and currentRecordNumber; it simply iterates through the numbers 0 <= currentRecordNumber < recordCount. You should set recordCount on open. Copyright 2008 Partner Software, Inc.
IterableInput.Status| Modifier and Type | Field and Description |
|---|---|
int |
currentRecordNumber |
int |
recordCount |
currentValues, fieldNames, verbose| Constructor and Description |
|---|
RandomAccessDataRecordSource() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
fetchImp()
Subclass implementation of guts of fetch() method.
|
Naming<java.lang.Object> |
fetchRecordAt(int recordNumber)
Return the record at the given number.
|
abstract java.lang.Object[] |
fetchValuesAt(int recordNumber)
Return the values for the record at the given number.
|
int |
getRecordCount() |
copy, fetch, getCurrentValues, getFetched, getFieldNames, isVerbose, setVerbose, toCogclose, closeImp, getException, getStatus, isFetchValid, iterator, open, openImppublic abstract java.lang.Object[] fetchValuesAt(int recordNumber)
Subclasses must implement this to take care of the actual fetching.
recordNumber - number of the record desired, starting with zero.public Naming<java.lang.Object> fetchRecordAt(int recordNumber)
recordNumber - number of the record desired, starting with zero.protected boolean fetchImp()
throws java.lang.Exception
AbstractIterableInputSubclasses must implement this to do the actual work required by fetch(). Feel free to throw exceptions; these are caught inside the fetch() itself and applied to the exception variable. Thus, you can focus on the actual task instead of paperwork.
fetchImp in class AbstractIterableInput<Naming<java.lang.Object>>java.lang.Exceptionpublic int getRecordCount()