FreeHEP API
Version v1.2.2

org.freehep.record.loop.examples
Class EchoStrings

java.lang.Object
  |
  +--org.freehep.record.loop.event.RecordAdapter
        |
        +--org.freehep.record.loop.examples.EchoStrings
All Implemented Interfaces:
EventListener, RecordListener

public class EchoStrings
extends RecordAdapter

This class gives the most basic example of how the org.freehep.record.loop package can be used. It implements, as a nested class, a SequentialRecordSource that reads a file and supplys each line read as a record. The class itself implements a RecordListener that prints the contents of each record, with which it is supplied, to the standard output.

Version:
$Id: EchoStrings.java,v 1.2 2003/05/09 21:41:54 tonyj Exp $
Author:
patton

Nested Class Summary
 class EchoStrings.LineSupplier
          Class to read in file line by line.
 class EchoStrings.StringsData
          Class to hold line read in from file.
 
Constructor Summary
EchoStrings()
          Create an instance of this class.
 
Method Summary
static void main(String[] args)
           
 void recordSupplied(RecordSuppliedEvent event)
          Called every time a new record is read by the SequentialRecordLoop's SequentialRecordSource object.
 
Methods inherited from class org.freehep.record.loop.event.RecordAdapter
configure, finish, reconfigure, resume, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoStrings

public EchoStrings()
Create an instance of this class.

Method Detail

recordSupplied

public void recordSupplied(RecordSuppliedEvent event)
Description copied from interface: RecordListener
Called every time a new record is read by the SequentialRecordLoop's SequentialRecordSource object.

Specified by:
recordSupplied in interface RecordListener
Overrides:
recordSupplied in class RecordAdapter
Parameters:
event - a RecordSuppliedEvent describing the data supplied.

main

public static void main(String[] args)
                 throws FileNotFoundException
FileNotFoundException

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.