Package eu.bandm.tools.message
Class MessageStoreSorted<M extends Message>
java.lang.Object
eu.bandm.tools.message.MessageStore_<M>
eu.bandm.tools.message.MessageStoreSorted<M>
- All Implemented Interfaces:
MessageReceiver<M>
Storage for a sequence of
Message
s in order of their arrival.
The nesting level between Message.Kind.logStart
and
Message.Kind.logEnd
is stored additionally.-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.message.MessageStore_
MessageStore_.ListModel, MessageStore_.TableModel
-
Field Summary
Modifier and TypeFieldDescriptionprotected @Opt Comparator<? super M>
If set, defines the storage order.Fields inherited from class eu.bandm.tools.message.MessageStore_
indents, listModel, messages, tableModel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionComparator<? super M>
getOrder()
Returns the comparator which rules the sequential order of storing.void
Adds the received message to the internal store and notifies all GUI objects.void
setOrder
(@Opt Comparator<? super M> comp) Set the comparator which rules the sequential order of storing.Methods inherited from class eu.bandm.tools.message.MessageStore_
clear, drainAndClear, drainTo, getListModel, getMessages, getSize, getTableModel, isEmpty, notifyGuiAdd, notifyGuiChanged_ALL, setListModel, setTableModel
-
Field Details
-
order
If set, defines the storage order. Otherwise it is by arrival.
-
-
Constructor Details
-
MessageStoreSorted
public MessageStoreSorted()
-
-
Method Details
-
setOrder
Set the comparator which rules the sequential order of storing. The current content will be re-ordered and the GUI models will be notified.
Ifcomp==null
, then no re-ordering takes place, and future messages will again be appended to the end of the store. -
getOrder
Returns the comparator which rules the sequential order of storing. -
receive
Adds the received message to the internal store and notifies all GUI objects.
If a comparator has been defined bysetOrder(Comparator)
then the new message is inserted directly before those which are of greater value, ie. after all those of equal value, which are older. In the absence of a comparator it is appended at the end.- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
- Specified by:
receive
in classMessageStore_<M extends Message>
-