org.freehep.record.source
Interface InteractiveRecordSource


public interface InteractiveRecordSource

Some methods useful when a record source is used in an interactive environment.

Version:
$Id: InteractiveRecordSource.java 8584 2006-08-10 23:06:37Z duns $

Method Summary
 boolean hasNext()
          Test if there are more records available.
 boolean hasPrevious()
          Test if a previous record is available.
 void previous()
          Steps back to the previous record.
 void skip(int index)
          Skip a certain number of records.
 

Method Detail

hasNext

boolean hasNext()
Test if there are more records available. Note that not all record sources know how many records are available, so the fact that hasNext returns true should be taken to mean that there may be more records available. Calling next() may still result in a NoSuchRecordException even if hasNext() returns true.

Returns:
true if there are (may be) more records available.

hasPrevious

boolean hasPrevious()
Test if a previous record is available. If the record source does not allow moving backwards this will always return false.

Returns:
true if a previous record is available.

previous

void previous()
              throws NoSuchRecordException
Steps back to the previous record.

Throws:
NoSuchRecordException - If no previous record is available.

skip

void skip(int index)
          throws NoSuchRecordException
Skip a certain number of records. There is no gaurantee that this is more efficient that reading all the intervening records.

Parameters:
index - The number of records to skip. Must be >= 0.
Throws:
NoSuchRecordException - If there are not enough records to skip


Copyright © 2000-2007 FreeHEP. All Rights Reserved.