Class BehaviorChangingMailbox
java.lang.Object
tools.refinery.interpreter.rete.network.mailbox.timeless.BehaviorChangingMailbox
- All Implemented Interfaces:
Clearable
,IGroupable
,FallThroughCapableMailbox
,Mailbox
This mailbox changes its behavior based on the position of its
Receiver
in the network topology.
It either behaves as a DefaultMailbox
or as an UpdateSplittingMailbox
. The decision is made by the
CommunicationTracker
, see TimelessCommunicationTracker.postProcessNode(Node)
for more details.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ReteContainer
protected boolean
protected CommunicationGroup
protected final Receiver
protected boolean
protected AdaptableMailbox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
deliverAll
(MessageSelector kind) Delivers all messages according to the given selector from this mailbox.Returns theCommunicationGroup
of the receiver of this mailbox.Returns theReceiver
of this mailbox.boolean
isEmpty()
Returns true if this mailbox is empty.boolean
void
postMessage
(Direction direction, Tuple update, Timestamp timestamp) Posts a new message to this mailbox.void
Sets theCommunicationGroup
that the receiver of this mailbox is associated with.void
setFallThrough
(boolean fallThrough) void
setSplitFlag
(boolean splitValue) toString()
-
Field Details
-
fallThrough
protected boolean fallThrough -
split
protected boolean split -
wrapped
-
receiver
-
container
-
group
-
-
Constructor Details
-
BehaviorChangingMailbox
-
-
Method Details
-
postMessage
Description copied from interface:Mailbox
Posts a new message to this mailbox.- Specified by:
postMessage
in interfaceMailbox
- Parameters:
direction
- the direction of the updateupdate
- the update element
-
deliverAll
Description copied from interface:Mailbox
Delivers all messages according to the given selector from this mailbox. The selector can also be null. In this case, no special separation is expected between the messages.- Specified by:
deliverAll
in interfaceMailbox
- Parameters:
kind
- the message selector
-
toString
-
setSplitFlag
public void setSplitFlag(boolean splitValue) -
isEmpty
public boolean isEmpty()Description copied from interface:Mailbox
Returns true if this mailbox is empty. -
clear
public void clear() -
getReceiver
Description copied from interface:Mailbox
Returns theReceiver
of this mailbox.- Specified by:
getReceiver
in interfaceMailbox
- Returns:
- the receiver
-
getCurrentGroup
Description copied from interface:Mailbox
Returns theCommunicationGroup
of the receiver of this mailbox.- Specified by:
getCurrentGroup
in interfaceIGroupable
- Specified by:
getCurrentGroup
in interfaceMailbox
- Returns:
- the communication group
-
setCurrentGroup
Description copied from interface:Mailbox
Sets theCommunicationGroup
that the receiver of this mailbox is associated with.- Specified by:
setCurrentGroup
in interfaceIGroupable
- Specified by:
setCurrentGroup
in interfaceMailbox
- Parameters:
group
- the communication group
-
isFallThrough
public boolean isFallThrough()- Specified by:
isFallThrough
in interfaceFallThroughCapableMailbox
-
setFallThrough
public void setFallThrough(boolean fallThrough) - Specified by:
setFallThrough
in interfaceFallThroughCapableMailbox
-