repast.simphony.data2
Class TabularFormatter

java.lang.Object
  extended by repast.simphony.data2.AbstractFormatter
      extended by 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
TabularFormatter(Collection<? extends DataSource> sources, String delimiter)
          Creates a Formatter that will format data form the specified sources.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getColumnNames

public List<String> getColumnNames()
Gets a list of the column names.

Returns:

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.