Package repast.simphony.data2
Class FileDataSink
- java.lang.Object
-
- repast.simphony.data2.FileDataSink
-
-
Constructor Summary
Constructors Constructor Description FileDataSink(String name, File file, Formatter formatter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(String key, Object value)
Appends the specified data to this sink.void
close()
Close this DataSink.void
flush()
Flushes any data buffered by this DataSink.File
getFile()
Gets the file this FileDataSink will write to.FormatType
getFormat()
Gets the format type for this FileDataSink.Formatter
getFormatter()
Gets the formatter used to format the data written using this FileDataSink.String
getName()
Gets the name of this FileDataSink.void
open(List<String> sourceIds)
Open this DataSink.void
recordEnded()
Notified this DataSink that the current record has ended.void
rowEnded()
Notifies this DataSink that the last append was end of a "row."void
rowStarted()
Notifies this DataSink that the next append is that start of a "row." of data.
-
-
-
Method Detail
-
getFile
public File getFile()
Gets the file this FileDataSink will write to.- Returns:
- the file this FileDataSink will write to.
-
getName
public String getName()
Gets the name of this FileDataSink.- Returns:
- the name of this FileDataSink.
-
getFormatter
public Formatter getFormatter()
Gets the formatter used to format the data written using this FileDataSink.- Returns:
- the formatter used to format the data written using this FileDataSink.
-
getFormat
public FormatType getFormat()
Gets the format type for this FileDataSink.- Returns:
- the format type for this FileDataSink.
-
open
public void open(List<String> sourceIds)
Description copied from interface:DataSink
Open this DataSink.
-
flush
public void flush()
Description copied from interface:DataSink
Flushes any data buffered by this DataSink.
-
rowStarted
public void rowStarted()
Description copied from interface:DataSink
Notifies this DataSink that the next append is that start of a "row." of data.- Specified by:
rowStarted
in interfaceDataSink
-
append
public void append(String key, Object value)
Description copied from interface:DataSink
Appends the specified data to this sink. The key can be, for example, a column name and the value the current value for that column.
-
rowEnded
public void rowEnded()
Description copied from interface:DataSink
Notifies this DataSink that the last append was end of a "row."
-
recordEnded
public void recordEnded()
Description copied from interface:DataSink
Notified this DataSink that the current record has ended.- Specified by:
recordEnded
in interfaceDataSink
-
-