public class FileEventStream extends AbstractEventStream implements Closeable
| Constructor and Description |
|---|
FileEventStream(File file)
Creates a new file event stream from the specified file.
|
FileEventStream(String fileName) |
FileEventStream(String fileName,
String encoding)
Creates a new file event stream from the specified file name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasNext()
Test whether there are any Events remaining in this EventStream.
|
static void |
main(String[] args)
Trains and writes a model based on the events in the specified event file.
|
Event |
next()
Returns the next Event object held in this EventStream.
|
static String |
toLine(Event event)
Generates a string representing the specified event.
|
removepublic FileEventStream(String fileName, String encoding) throws IOException
fileName - the name fo the file containing the events.IOException - When the specified file can not be read.public FileEventStream(String fileName) throws IOException
IOExceptionpublic FileEventStream(File file) throws IOException
file - the file containing the events.IOException - When the specified file can not be read.public boolean hasNext()
EventStreamhasNext in interface EventStreampublic Event next()
EventStreamnext in interface EventStreampublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic static String toLine(Event event)
event - The event for which a string representation is needed.public static void main(String[] args) throws IOException
args - eventfile [iterations cuttoff]IOException - when the eventfile can not be read or the model file can not be written.Copyright © 2016 The Apache Software Foundation. All rights reserved.