FreeHEP API
Version current

org.freehep.record.loop
Class SequentialRecordLoopImplManager

java.lang.Object
  extended byorg.freehep.record.loop.SequentialRecordLoopImplManager
All Implemented Interfaces:
SequentialRecordLoopManager

public class SequentialRecordLoopImplManager
extends Object
implements SequentialRecordLoopManager

The class is an implementation of the SequentialRecordLoopManager class that can manage the default SequentialRecordLoop implementation.

Version:
$Id: SequentialRecordLoopImplManager.java,v 1.1 2003/05/06 23:13:16 tonyj Exp $
Author:
patton
Source Code:
SequentialRecordLoopImplManager.java

Constructor Summary
SequentialRecordLoopImplManager(SequentialRecordLoopImpl recordLoop)
          Create an instance of this class which is going to manage the specified SequentialRecordLoopImpl object.
 
Method Summary
 void beginLoop(long target)
          This method should be called before any loop begins.
 long endLoop()
          This method should be called after the loop has ended.
 SequentialRecordLoop getRecordLoop()
           
 boolean hasMoreRecords()
          Returns true if there may be more records available and the number supplied has not reached the target.
 Object nextRecord()
          This attempts to get a new record object from the source.
 void supplyRecord(Object record)
          Supplies the specified record object, if it is not null, to the listener of the SequentialRecordLoopImpl object being managed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialRecordLoopImplManager

public SequentialRecordLoopImplManager(SequentialRecordLoopImpl recordLoop)
Create an instance of this class which is going to manage the specified SequentialRecordLoopImpl object.

Parameters:
recordLoop - the object those loop is to be managed.
Method Detail

beginLoop

public void beginLoop(long target)
               throws IllegalStateException
Description copied from interface: SequentialRecordLoopManager
This method should be called before any loop begins.

Specified by:
beginLoop in interface SequentialRecordLoopManager
Parameters:
target - the number of records that should have been supplied.
Throws:
IllegalStateException - if this is called before a source is set in the SequentialRecordLoopImpl object being managed.

endLoop

public long endLoop()
             throws LoopException
Description copied from interface: SequentialRecordLoopManager
This method should be called after the loop has ended.

Specified by:
endLoop in interface SequentialRecordLoopManager
Returns:
the number of countable records that have been supplied.
Throws:
LoopException

getRecordLoop

public SequentialRecordLoop getRecordLoop()
Specified by:
getRecordLoop in interface SequentialRecordLoopManager
Returns:
the SequentialRecordLoop object this object is managing.

nextRecord

public Object nextRecord()
                  throws IOException
Description copied from interface: SequentialRecordLoopManager
This attempts to get a new record object from the source. Before invoking the getCurrentRecord method, this routine checks to see if an interrupt has been requested, and if so set the internal flag to indicate this is the case.

Specified by:
nextRecord in interface SequentialRecordLoopManager
Returns:
the record object supplied or null if no object is supplied.
Throws:
IOException - if there is a problem reading the next record.

hasMoreRecords

public boolean hasMoreRecords()
Description copied from interface: SequentialRecordLoopManager
Returns true if there may be more records available and the number supplied has not reached the target.

Specified by:
hasMoreRecords in interface SequentialRecordLoopManager

supplyRecord

public void supplyRecord(Object record)
Description copied from interface: SequentialRecordLoopManager
Supplies the specified record object, if it is not null, to the listener of the SequentialRecordLoopImpl object being managed.

Specified by:
supplyRecord in interface SequentialRecordLoopManager
Parameters:
record - the record object to be supplied.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.