FreeHEP API
Version current

org.freehep.record.loop.examples
Class Strings2Words

java.lang.Object
  extended byorg.freehep.record.loop.event.RecordAdapter
      extended byorg.freehep.record.loop.examples.Strings2Words
All Implemented Interfaces:
EventListener, RecordListener

public class Strings2Words
extends RecordAdapter

This class is am example of how to chain RecordListener objects can be chained. This process allows more than one listener to be executed during the loop method of an SequentialRecordLoop object. This example uses the listener in the EchoStrings example, but this listener is chained behind an instance of this class which is an RecordListener that replaces the Strings in the record with a new set of strings containing the individual words from the original strings. Thus the EchoStrings listener will output one word on each line, rather than a line at a time.

Version:
$Id: Strings2Words.java,v 1.1 2003/05/06 23:02:07 tonyj Exp $
Author:
patton
Source Code:
Strings2Words.java

Constructor Summary
Strings2Words()
          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

Strings2Words

public Strings2Words()
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.