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
in the order of arrival.
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 ClassesModifier and TypeClassDescriptionclass
Standard specialisation ofAbstractListModel
.class
Standard specialisation ofAbstractTableModel
. -
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.get
(int i) Return the message stored at the given poisition.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, 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. Counts the nesting level ofMessage.Kind.logStart
andMessage.Kind.logEnd
messages. 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.
-
get
Return the message stored at the given poisition.- Parameters:
i
- the position of the returned message, >= 0.- Returns:
- the message stored at the given poisition.
-