public class Protocol extends Annotated
Constructor and Description |
---|
Protocol()
Creates a default Protocol with no name.
|
Protocol(java.lang.String name)
Creates a named Protocol.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Event event)
Reports whether this Protocol accepts an Event in its current Memory
state.
|
Protocol |
addMemory(Memory memory)
Adds the Memory to this Protocol.
|
Protocol |
addOperation(Operation operation)
Adds an Operation to this Protocol's set of Operations.
|
protected Warning |
checkDifference(Notice topInfo,
Alphabet difference)
Checks the difference between the Machine alphabet and the Protocol
alphabet.
|
boolean |
fireEvent(Event event)
Fires an event on this Protocol.
|
Alphabet |
getAlphabet()
Returns the Alphabet of this Protocol.
|
Memory |
getMemory()
Returns the memory of this service.
|
Operation |
getOperation(Event event)
Returns the Operation corresponding to the supplied Event.
|
Operation |
getOperation(java.lang.String name)
Returns the Operation with the specified unique name.
|
java.util.Set<Operation> |
getOperations()
Returns all the Operations of this Protocol, as a set.
|
Scenario |
getScenario(Event event)
Returns the Scenario corresponding to the supplied Event.
|
Protocol |
reset()
Resets this Protocol to its initial state.
|
Protocol |
verifyProtocol(Machine machine)
Verifies this Protocol for formal consistency and completeness.
|
equals, getName, hashCode, setName, setName, toString
safeEquals, safeHashCode, semanticError
public Protocol()
public Protocol(java.lang.String name)
name
- the name of this Protocol.public Protocol addMemory(Memory memory)
memory
- the Memory to add.public Memory getMemory()
public Protocol addOperation(Operation operation)
operation
- the Operation to add.public Operation getOperation(java.lang.String name)
name
- the name of the Operation.public java.util.Set<Operation> getOperations()
public Alphabet getAlphabet()
public Scenario getScenario(Event event)
event
- the Event.public Operation getOperation(Event event)
event
- the Event.public Protocol reset()
public boolean accept(Event event)
event
- an Event.public boolean fireEvent(Event event)
event
- an Event.public Protocol verifyProtocol(Machine machine)
machine
- the associated Machine, for comparison.protected Warning checkDifference(Notice topInfo, Alphabet difference)
topInfo
- the top-level Notice.difference
- the extra events present in the Machine alphabet.