com.k_int.IR
Class ReadAheadEnumeration

java.lang.Object
com.k_int.IR.ReadAheadEnumeration
- All Implemented Interfaces:
- AsynchronousEnumeration, java.util.Enumeration
- public class ReadAheadEnumeration
- extends java.lang.Object
- implements AsynchronousEnumeration
Enumerate the result records from an InformationFragmentSource.
As normal FragmentSourceEnumeration, but caches chunks of records
as presented by target. E.G. Fetch chunk_size rows, getNext returns 1,2,3,4...
on 11, calls fetch again. And don't I wish I called it iterator instead....
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
private InformationFragmentSource source
current_element
private int current_element
min_cache_size
private int min_cache_size
fragment_cache
private java.util.LinkedList fragment_cache
fetching
private boolean fetching
chunk_size
private int chunk_size
spec
private RecordFormatSpecification spec
next_to_request
private int next_to_request
next_record_timeout
private int next_record_timeout
notification_target
private java.lang.ref.WeakReference notification_target
cat
private static LoggingContext cat
rae_present_callback_handler
IFSNotificationTarget rae_present_callback_handler
ReadAheadEnumeration
private ReadAheadEnumeration()
ReadAheadEnumeration
public ReadAheadEnumeration(InformationFragmentSource source)
ReadAheadEnumeration
public ReadAheadEnumeration(InformationFragmentSource source,
int chunk_size)
ReadAheadEnumeration
public ReadAheadEnumeration(InformationFragmentSource source,
RecordFormatSpecification spec,
java.lang.Object notification_target)
ReadAheadEnumeration
public ReadAheadEnumeration(InformationFragmentSource source,
RecordFormatSpecification spec)
ReadAheadEnumeration
public ReadAheadEnumeration(InformationFragmentSource source,
RecordFormatSpecification spec,
int chunk_size,
int next_record_timeout,
java.lang.Object notification_target)
hasMoreElements
public boolean hasMoreElements()
- Description copied from interface:
java.util.Enumeration
- Tests whether there are elements remaining in the enumeration.
- Specified by:
hasMoreElements in interface java.util.Enumeration
nextElement
public java.lang.Object nextElement()
- Description copied from interface:
java.util.Enumeration
- Obtain the next element in the enumeration.
- Specified by:
nextElement in interface java.util.Enumeration
checkCache
private void checkCache()
requestRecords
private void requestRecords()
nextIsAvailable
public boolean nextIsAvailable()
- Description copied from interface:
AsynchronousEnumeration
- We know that there will be a next record in this set, is it available yet?
- Specified by:
nextIsAvailable in interface AsynchronousEnumeration
getStatus
public IRStatusReport getStatus()
- Specified by:
getStatus in interface AsynchronousEnumeration
waitForNextRecord
public void waitForNextRecord(int timeout)
registerNotificationTarget
public void registerNotificationTarget(java.lang.Object o)
- Description copied from interface:
AsynchronousEnumeration
- Register an object to be notified when a next object is available
- Specified by:
registerNotificationTarget in interface AsynchronousEnumeration