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 ReteContainerprotected booleanprotected CommunicationGroupprotected final Receiverprotected booleanprotected AdaptableMailbox -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voiddeliverAll(MessageSelector kind) Delivers all messages according to the given selector from this mailbox.Returns theCommunicationGroupof the receiver of this mailbox.Returns theReceiverof this mailbox.booleanisEmpty()Returns true if this mailbox is empty.booleanvoidpostMessage(Direction direction, Tuple update, Timestamp timestamp) Posts a new message to this mailbox.voidSets theCommunicationGroupthat the receiver of this mailbox is associated with.voidsetFallThrough(boolean fallThrough) voidsetSplitFlag(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:MailboxPosts a new message to this mailbox.- Specified by:
postMessagein interfaceMailbox- Parameters:
direction- the direction of the updateupdate- the update element
-
deliverAll
Description copied from interface:MailboxDelivers 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:
deliverAllin interfaceMailbox- Parameters:
kind- the message selector
-
toString
-
setSplitFlag
public void setSplitFlag(boolean splitValue) -
isEmpty
public boolean isEmpty()Description copied from interface:MailboxReturns true if this mailbox is empty. -
clear
public void clear() -
getReceiver
Description copied from interface:MailboxReturns theReceiverof this mailbox.- Specified by:
getReceiverin interfaceMailbox- Returns:
- the receiver
-
getCurrentGroup
Description copied from interface:MailboxReturns theCommunicationGroupof the receiver of this mailbox.- Specified by:
getCurrentGroupin interfaceIGroupable- Specified by:
getCurrentGroupin interfaceMailbox- Returns:
- the communication group
-
setCurrentGroup
Description copied from interface:MailboxSets theCommunicationGroupthat the receiver of this mailbox is associated with.- Specified by:
setCurrentGroupin interfaceIGroupable- Specified by:
setCurrentGroupin interfaceMailbox- Parameters:
group- the communication group
-
isFallThrough
public boolean isFallThrough()- Specified by:
isFallThroughin interfaceFallThroughCapableMailbox
-
setFallThrough
public void setFallThrough(boolean fallThrough) - Specified by:
setFallThroughin interfaceFallThroughCapableMailbox
-