Package eu.bandm.tools.message
Class MessageStore<M extends Message>
java.lang.Object
eu.bandm.tools.message.MessageStore_<M>
eu.bandm.tools.message.MessageStore<M>
- Type Parameters:
M
- the type of the messages
- All Implemented Interfaces:
MessageReceiver<M>
Storage for a sequence of
Message
s in order of their arrival.
All messages received are added to an internal sequential storage.
Additionally the nesting level of Message.Kind.logStart
and
Message.Kind.logEnd
messages is stored, which can be
rendered by a GUI.-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.message.MessageStore_
MessageStore_.ListModel, MessageStore_.TableModel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Internal state for storing the nesting ofMessage.Kind.logStart
andMessage.Kind.logEnd
messages.Fields inherited from class eu.bandm.tools.message.MessageStore_
indents, listModel, messages, tableModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Resets nesting level to 0.void
Adds the received message to the internal store and notifies all GUI objects.Methods inherited from class eu.bandm.tools.message.MessageStore_
clear, drainAndClear, drainTo, get, getListModel, getMessages, getSize, getTableModel, isEmpty, notifyGuiAdd, notifyGuiChanged_ALL, setListModel, setTableModel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.message.MessageReceiver
ifSubcriticalThen, ifSubcriticalThen, ifSubcriticalThenElse
-
Field Details
-
nestingLevel
protected int nestingLevelInternal state for storing the nesting ofMessage.Kind.logStart
andMessage.Kind.logEnd
messages. Is always >=0, also in case of inconsistent nesting of incomming messages.
-
-
Constructor Details
-
MessageStore
public MessageStore()Only constructor
-
-
Method Details
-
clearNestingLevel
public void clearNestingLevel()Resets nesting level to 0. -
receive
Adds the received message to the internal store and notifies all GUI objects.Indentation is increased after a
Message.Kind.logStart
and decreased after aMessage.Kind.logEnd
message, but never goes below zero(0).- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
- Specified by:
receive
in classMessageStore_<M extends Message>
- Parameters:
message
- the received message.
-