Generating port code in Java
The following operations are used for working with ports and events in Java:
About this task
- Calling an operation:
- for port called
MyPor
t and operation calledmyop
:
getMyPort().myop();
- for port called
MyPort
, operation calledmyop
, and multiplicity greater than 1:getMyPortAt(port index).myop()
, for example,
getMyPortAt(2).myop();
- for port called
- Generating and sending an event through a port:
- for port called
MyPort
and event calledevt
:
getMyPort().gen(new evt());
- for port called
MyPort
, event callede2
, and multiplicity greater than 1:getMyPortAt(port index).gen(new e2())
, for example,
getMyPortAt(2).gen(new e2());
- for port called
- Detecting the input port through which an event has been sent:
- for port called
MyPort
:
isPort(getMyPort())
- for port called
MyPort
, and multiplicity greater than 1:isPort(getMyPort(port index
)), for example,
isPort(getMyPort(3))
- for port called