public abstract class MessageDemux<E extends Enum<E>,M extends Message> extends PrimitiveMessageDemux<E,M>
PrimitiveMessageDemux
in so far
it calculates a set of enum values for every message it receives, and then
calls the PrimitiveMessageDemux.receive(Enum,Message)
method for all these.Modifier and Type | Class and Description |
---|---|
static class |
MessageDemux.All<E extends Enum<E>,M extends Message>
Trivial instantiation of
MessageDemux which propagates each message
to all receivers in the map, as it has been constructed
by PrimitiveMessageDemux.setReceiver(Enum,MessageReceiver) |
static class |
MessageDemux.ByKind<M extends Message>
A
MessageDemux which sorts messages by their kind. |
outlets, tagclass
Constructor and Description |
---|
MessageDemux(Class<E> tagclass) |
Modifier and Type | Method and Description |
---|---|
static <E extends Enum<E>,M extends Message> |
all(Class<E> tags)
Delivers a trivial instantiation of
MessageDemux , see MessageDemux.All . |
static <M extends Message> |
byKind()
factory method for
MessageDemux.ByKind |
protected abstract EnumSet<E> |
getOutputTags(M m)
Has to be re-defined by derived classes to calculate the set of
enum items which indicate the receivers the message shall be propagated to.
|
void |
receive(M message)
Propagates the received message to all receivers indicated by the calculated
enum item set.
|
getReceiver, receive, setReceiver
protected abstract EnumSet<E> getOutputTags(M m)
public void receive(M message)
getOutputTags(Message)
to calculate this set.public static <E extends Enum<E>,M extends Message> MessageDemux<E,M> all(Class<E> tags)
MessageDemux
, see MessageDemux.All
.public static <M extends Message> MessageDemux<Message.Kind,M> byKind()
MessageDemux.ByKind
see also the complete user documentation .