Package repast.simphony.data2
Class AbstractFormatter
- java.lang.Object
-
- repast.simphony.data2.AbstractFormatter
-
- All Implemented Interfaces:
Formatter
- Direct Known Subclasses:
LineFormatter
,TabularFormatter
public abstract class AbstractFormatter extends Object implements Formatter
Abstract base class for Formatters.- Author:
- Nick Collier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractFormatter.ItemFormatter
protected static class
AbstractFormatter.RuntimeTestFormatter
protected static class
AbstractFormatter.StringFormatter
-
Constructor Summary
Constructors Constructor Description AbstractFormatter(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 void
addData(String id, Object obj)
Adds the specified object to the data to be formatted.void
clear()
Clears this formatter of any data that has been added for formatting.String
getDelimiter()
Gets the delimiter used by this Formatter.void
setDelimiter(String delimiter)
Sets the delimiter used by this formatter.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface repast.simphony.data2.Formatter
formatData, getFormatType, getHeader
-
-
-
-
Field Detail
-
keyMap
protected Map<String,AbstractFormatter.ItemFormatter> keyMap
-
data
protected String[] data
-
delimiter
protected String delimiter
-
-
Constructor Detail
-
AbstractFormatter
public AbstractFormatter(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
-
clear
public void clear()
Clears this formatter of any data that has been added for formatting.
-
addData
public void addData(String id, Object obj)
Adds the specified object to the data to be formatted.
-
getDelimiter
public String getDelimiter()
Description copied from interface:Formatter
Gets the delimiter used by this Formatter.- Specified by:
getDelimiter
in interfaceFormatter
- Returns:
-
setDelimiter
public void setDelimiter(String delimiter)
Description copied from interface:Formatter
Sets the delimiter used by this formatter.- Specified by:
setDelimiter
in interfaceFormatter
-
-