FreeHEP API
Version current

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,v 1.1 2003/03/10 21:56:05 tonyj Exp $
Source Code:
InteractiveRecordSource.java

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

public 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

public 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

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

Throws:
NoSuchRecordException - If no previous record is available.

skip

public 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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.