|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface allows control of a
object to be managed by an external object. The external object is
responsible for making sure the methods of this object are called in the
correct order. The following how the methods should be invoked, where
SequentialRecordLoop
number
is the number of records that the external object is
trying to supply.
manager.beginLoop(number); while (manager.hasMoreRecords()) { manager.supplyRecord(manager.nextRecord()); } long result = manager.endLoop();
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. |
Method Detail |
public void beginLoop(long target)
target
- the number of records that should have been supplied.
IllegalStateException
- if this is called before a
source is set in the SequentialRecordLoopImpl object being managed.public long endLoop() throws LoopException
LoopInterruptedException
- if the loop is interrupted.
LoopSourceExhaustedException
- if target is non-negative and the
source runs out of records.
NoLoopRecordException
- if the record to supply could not be
found.
LoopException
public SequentialRecordLoop getRecordLoop()
public Object nextRecord() throws IOException
IOException
- if there is a problem reading the next record.public boolean hasMoreRecords()
public void supplyRecord(Object record)
record
- the record object to be supplied.
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |