- Direct Known Subclasses:
public class FileEventStream extends Object implements ObjectStream<Event>Class for using a file of events as an event stream. The format of the file is one event perline with each line consisting of outcome followed by contexts (space delimited).
Constructors Constructor Description
FileEventStream(File file)Creates a new file event stream from the specified file.
FileEventStream(String fileName, String encoding)Creates a new file event stream from the specified file name.
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
ObjectStreamand releases all allocated resources.
read()Returns the next object.
reset()Repositions the stream at the beginning and the previously seen object sequence will be repeated exactly.
toLine(Event event)Generates a string representing the specified event.
public FileEventStream(String fileName, String encoding) throws IOExceptionCreates a new file event stream from the specified file name.
fileName- the name fo the file containing the events.
IOException- When the specified file can not be read.
public Event read() throws IOExceptionReturns the next object. Calling this method repeatedly until it returns null will return each object from the underlying source exactly once.
public void close() throws IOExceptionCloses the
ObjectStreamand releases all allocated resources. After close was called its not allowed to call read or reset.
toLineGenerates a string representing the specified event.
event- The event for which a string representation is needed.
- A string representing the specified event.
public void reset() throws IOException, UnsupportedOperationExceptionRepositions the stream at the beginning and the previously seen object sequence will be repeated exactly. This method can be used to re-read the stream if multiple passes over the objects are required. The implementation of this method is optional.