Package db
Class ConstrainedForwardRecordIterator
java.lang.Object
db.ConstrainedForwardRecordIterator
- All Implemented Interfaces:
RecordIterator
ConstrainedForwardRecordIterator provides the ability to both filter and
translate records returned from an underlying RecordIterator.-
Constructor Summary
ConstructorsConstructorDescriptionConstrainedForwardRecordIterator(RecordIterator it, Function<DBRecord, DBRecord> recordPredicateAndTranslate) Construct a constrained/filtered record iterator. -
Method Summary
Modifier and TypeMethodDescriptionbooleandelete()Delete the last Record read via the next or previous methods.booleanhasNext()Return true if a Record is available in the forward direction.booleanReturn true if a Record is available in the reverse directionnext()Return the next Record or null if one is not available.previous()Return the previous Record or null if one is not available.
-
Constructor Details
-
ConstrainedForwardRecordIterator
public ConstrainedForwardRecordIterator(RecordIterator it, Function<DBRecord, DBRecord> recordPredicateAndTranslate) Construct a constrained/filtered record iterator.- Parameters:
it- source record iteratorrecordPredicateAndTranslate- function which enables both filtering of records (null returned if record should be skipped) and the ability to translate the record to an alternate table/record schema.
-
-
Method Details
-
hasPrevious
public boolean hasPrevious()Description copied from interface:RecordIteratorReturn true if a Record is available in the reverse direction- Specified by:
hasPreviousin interfaceRecordIterator
-
previous
Description copied from interface:RecordIteratorReturn the previous Record or null if one is not available.- Specified by:
previousin interfaceRecordIterator
-
delete
Description copied from interface:RecordIteratorDelete the last Record read via the next or previous methods.- Specified by:
deletein interfaceRecordIterator- Returns:
- true if record was successfully deleted.
- Throws:
IOException- thrown if an IO error occurs.
-
hasNext
Description copied from interface:RecordIteratorReturn true if a Record is available in the forward direction.- Specified by:
hasNextin interfaceRecordIterator- Throws:
IOException- thrown if an IO error occurs
-
next
Description copied from interface:RecordIteratorReturn the next Record or null if one is not available.- Specified by:
nextin interfaceRecordIterator- Throws:
IOException- thrown if an IO error occurs
-