FreeHEP API
Version current

org.freehep.record.loop.examples
Class EchoStrings

java.lang.Object
  extended byorg.freehep.record.loop.event.RecordAdapter
      extended byorg.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.3 2004/01/19 21:23:52 duns Exp $
Author:
patton
Source Code:
EchoStrings.java

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

main

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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.