ColT
- type of Collectable
this strategy is processingCollectMsgT
- the type of CollectMessage
usedpublic abstract class MessageCollectStrategy<ColT extends Collectable<?>,CollectMsgT extends CollectMessage> extends Object implements CollectStrategy<ColT>
CollectStrategy
using
CollectMessage
objects created via factory.
Implementing classes need to specify the CollectMessageFactory
generating the messages and how the collectable is updated using them.
Constructor and Description |
---|
MessageCollectStrategy() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
collect(CollectMsgT message,
ColT collectable)
Collects data.
|
protected abstract CollectMessageFactory<CollectMsgT> |
getCollectMessageFactory()
Returns the
CollectMessageFactory that creates suitable messages. |
void |
process(SimState state,
ColT collectable)
Processes this strategy.
|
String |
toString() |
protected abstract void collect(CollectMsgT message, ColT collectable)
CollectMessage
.
Implementing classes need to specify how the message updates the
collectable.message
- the CollectMessage
providing the required informationcollectable
- the Collectable
to be processedprotected abstract CollectMessageFactory<CollectMsgT> getCollectMessageFactory()
CollectMessageFactory
that creates suitable messages.CollectMessageFactory
public void process(SimState state, ColT collectable)
CollectStrategy
process
in interface CollectStrategy<ColT extends Collectable<?>>
state
- the simulation statecollectable
- the Collectable
to be processed