AnyLogic
Expand
Font size
Type Parameters:
InMessageType - the type of messages being received by the port
OutMessageType - the type of messages being sent by the port
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Serializable

public class FlowchartMappedPort<InMessageType,OutMessageType>
extends FlowchartPort<InMessageType,OutMessageType>
An implementation of FlowchartPort which delegates its count() and isError() methods to another port, this one is mapped with.
Usage: create a custom port of this type and add connector from this port to the port of embedded object (or call map(Port) on this port).
There should be one and only one mapped port, otherwise an error will be thrown.
Since:
7.0
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
FlowchartPortPortSerialized Form

Constructor Summary

ConstructorDescription
FlowchartMappedPort(FlowchartBlock ao) 

Method Summary

Modifier and TypeMethodDescription
longcount()
Returns the number of agents passed through this port so far
voiddisconnectAndUnmapAll()
Disconnects and unmaps the port from all ports and statechart it is connected and/or mapped to.
booleanisCannotAccept()
Returns true if this (input) port can't accept agents at the current time.
booleanisError()
Returns true if there is an error with this port, e.g.
booleanisReadyToExit()
Returns true if there is some agent ready to exit this (output) port.
voidmap(Port<InMessageType,OutMessageType> port)
Maps (connects) the port to a port of an embedded object.
voidmarkError()
Marks this port as having error
voidunmap(Port<InMessageType,OutMessageType> port)
Unmaps (disconnects) the port from a port of an embedded object.

Methods inherited from class com.anylogic.engine.FlowchartPort

getAgent, getFlowchartBlockRepresentative, getFlowchartBlockRepresentative, isPortStateAnimated, toString

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Details

FlowchartMappedPort

public FlowchartMappedPort(FlowchartBlock ao)

Method Details

map

public void map(Port<InMessageType,OutMessageType> port)
Description copied from class: Port
Maps (connects) the port to a port of an embedded object. send(msg) called on another port will result in send(msg) called on this port and receive(msg) called on this port will result in receive(msg) called on another port.
Overrides:
map in class Port<InMessageType,OutMessageType>
Parameters:
port - port of an embedded object

unmap

public void unmap(Port<InMessageType,OutMessageType> port)
Description copied from class: Port
Unmaps (disconnects) the port from a port of an embedded object.
Overrides:
unmap in class Port<InMessageType,OutMessageType>
Parameters:
port - port of an embedded object

disconnectAndUnmapAll

public void disconnectAndUnmapAll()
Description copied from class: Port
Disconnects and unmaps the port from all ports and statechart it is connected and/or mapped to.
Overrides:
disconnectAndUnmapAll in class Port<InMessageType,OutMessageType>

markError

public void markError()
Marks this port as having error
Specified by:
markError in class FlowchartPort<InMessageType,OutMessageType>
Throws:
NullPointerException - if this port has no mapped port

isError

public boolean isError()
Description copied from class: FlowchartPort
Returns true if there is an error with this port, e.g. "the agent at the head of the queue has spent a non-zero time at this port".
Specified by:
isError in class FlowchartPort<InMessageType,OutMessageType>
Returns:
true if there is an error with this port
Throws:
NullPointerException - if this port has no mapped port
See Also:
FlowchartPort.isError()

isCannotAccept

public boolean isCannotAccept()
Description copied from class: FlowchartPort
Returns true if this (input) port can't accept agents at the current time.
Overrides:
isCannotAccept in class FlowchartPort<InMessageType,OutMessageType>
Throws:
NullPointerException - if this port has no mapped port
See Also:
FlowchartPort.isCannotAccept()

isReadyToExit

public boolean isReadyToExit()
Description copied from class: FlowchartPort
Returns true if there is some agent ready to exit this (output) port.
Overrides:
isReadyToExit in class FlowchartPort<InMessageType,OutMessageType>
Throws:
NullPointerException - if this port has no mapped port
See Also:
FlowchartPort.isReadyToExit()

count

public long count()
Description copied from class: FlowchartPort
Returns the number of agents passed through this port so far
Specified by:
count in class FlowchartPort<InMessageType,OutMessageType>
Returns:
the number of agents passed through this port so far
Throws:
NullPointerException - if this port has no mapped port
See Also:
FlowchartPort.count()