ColT
- the type of the contained Collectable
public abstract class StrategyCollector<ColT extends Collectable<?>> extends Object implements sim.portrayal.inspector.ProvidesInspector, Collector
Constructor and Description |
---|
StrategyCollector() |
Modifier and Type | Method and Description |
---|---|
void |
collect(SimState state)
Collects data.
|
static <ColT extends Collectable<?>> |
create(ColT collectable,
CollectStrategy<ColT> strategy)
Creates a
StrategyCollector . |
OutputWriter |
createWriter(Path outputPath)
Returns the writer from collectable.
|
abstract ColT |
getCollectable()
Returns the
Collectable to be processed by the strategy. |
String |
getName()
Returns the name of the collectable, which contents are displayed on
inspection.
|
abstract CollectStrategy<ColT> |
getStrategy()
Returns the
CollectStrategy to be used. |
Inspector |
provideInspector(GUIState state,
String name) |
String |
toString() |
public static <ColT extends Collectable<?>> StrategyCollector<ColT> create(ColT collectable, CollectStrategy<ColT> strategy)
StrategyCollector
.collectable
- the Collectable
to be processed by the strategystrategy
- the CollectStrategy
to be usedStrategyCollector
public abstract ColT getCollectable()
Collectable
to be processed by the strategy.Collectable
to be processed by the strategypublic abstract CollectStrategy<ColT> getStrategy()
CollectStrategy
to be used. Implementing classes need
to specify this.CollectStrategy
to be usedpublic final void collect(SimState state)
Collector
CollectMessage
.public Inspector provideInspector(GUIState state, String name)
provideInspector
in interface sim.portrayal.inspector.ProvidesInspector
public OutputWriter createWriter(Path outputPath)
createWriter
in interface Collector
outputPath
- the output pathOutputWriter
for this collectorCollectable.createWriter(Path)
public String getName()