Package repast.simphony.data2
Class TabularFormatter
- java.lang.Object
-
- repast.simphony.data2.AbstractFormatter
-
- repast.simphony.data2.TabularFormatter
-
- All Implemented Interfaces:
Formatter
public class TabularFormatter extends AbstractFormatter
Formats data in a tabular format with a user specified delimiter.- Author:
- Nick Collier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class repast.simphony.data2.AbstractFormatter
AbstractFormatter.ItemFormatter, AbstractFormatter.RuntimeTestFormatter, AbstractFormatter.StringFormatter
-
-
Field Summary
-
Fields inherited from class repast.simphony.data2.AbstractFormatter
data, delimiter, keyMap
-
-
Constructor Summary
Constructors Constructor Description TabularFormatter(Collection<? extends DataSource> sources, String delimiter)
Creates a Formatter that will format data form the specified sources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
formatData()
Formats the data that has been added to this Formatter.List<String>
getColumnNames()
Gets a list of the column names.FormatType
getFormatType()
Gets the type associated with this Formatter.String
getHeader()
Gets the ids of the formatted data sources, quoted and separated by the delimiter.-
Methods inherited from class repast.simphony.data2.AbstractFormatter
addData, clear, getDelimiter, setDelimiter
-
-
-
-
Constructor Detail
-
TabularFormatter
public TabularFormatter(Collection<? extends DataSource> sources, String delimiter)
Creates a Formatter that will format data form the specified sources. The ids of the sources will become the header info.- Parameters:
sources
-
-
-
Method Detail
-
getHeader
public String getHeader()
Gets the ids of the formatted data sources, quoted and separated by the delimiter.- Returns:
- the ids of the formatted data sources, quoted and separated by the delimiter.
-
formatData
public String formatData()
Description copied from interface:Formatter
Formats the data that has been added to this Formatter.- Returns:
- the formatted data.
-
getFormatType
public FormatType getFormatType()
Description copied from interface:Formatter
Gets the type associated with this Formatter.- Returns:
- the type associated with this Formatter.
-
-