The Physiologist's Friend Simulation API

ch.unizh.ini.friend.record
Class SpikeLogger

java.lang.Object
  extended by ch.unizh.ini.friend.record.SpikeLogger
All Implemented Interfaces:
SpikeListener, EventListener

public class SpikeLogger
extends Object
implements SpikeListener

Logs SpikeEvent's to a File. The spikes times are logged along with the string representation of an artibtray object that is passed on construction. To use this class, create a SpikeLogger, open() it, and add the SpikeLogger as a SpikeListener to the reporter.

File format

Comments have '#' in first character of line. Header line has date of creation and creator class. Data is logged as 1 spike/line. If an object is passed to append to spikes times, spikes times are followed by ',' and object. For example

# SpikeLogger ...
320
450
or
# SpikeLogger ...
32,16,43
1500,54,879
# SpikeLogger ...

Version:
$Revision: 1.1 $
Author:
$Author: tobi $

Constructor Summary
SpikeLogger(File f)
           
SpikeLogger(File f, Object o)
           
 
Method Summary
 void close()
          closes the file.
 void open()
          open the file for output.
 void spikeOccurred(SpikeEvent e)
          called by spike source (SpikeReporter) when a spike is detected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpikeLogger

public SpikeLogger(File f)

SpikeLogger

public SpikeLogger(File f,
                   Object o)
Method Detail

open

public void open()
          throws IOException
open the file for output.

Throws:
IOException

close

public void close()
           throws IOException
closes the file.

Throws:
IOException

spikeOccurred

public void spikeOccurred(SpikeEvent e)
called by spike source (SpikeReporter) when a spike is detected

Specified by:
spikeOccurred in interface SpikeListener
Parameters:
e - the spike event

http://www.ini.unizh.ch/~tobi/friend