is.lill.acre.protocol
Class Protocol

java.lang.Object
  extended by is.lill.acre.protocol.Protocol

public class Protocol
extends java.lang.Object

Class to represent a communication protocol as a finite state machine.


Constructor Summary
Protocol()
          Default constructor to create an empty protocol
Protocol(ProtocolDescriptor descriptor)
          Create protocol with specified name
 
Method Summary
protected  void addImport(ProtocolDescriptor desc)
           
 void addState(State state)
          Add a State to this Protocol
 void addTransition(Transition transition)
           
 boolean equals(java.lang.Object o)
           
 ProtocolDescriptor getDescriptor()
           
 State getInitialState()
           
 State getStateByName(java.lang.String name)
           
 java.util.Collection<State> getStates()
           
 java.util.Set<Transition> getTransitions()
          Retrieve the set of transitions associated with this protocol
 int hashCode()
           
 boolean importsFrom(ProtocolDescriptor desc)
           
 boolean initiates(IACREMessage m)
           
 void merge(Protocol p)
          Merge the states and transitions of the provided protocol into this one
 void setDescriptor(ProtocolDescriptor descriptor)
           
 java.lang.String toDebuggingString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Protocol

public Protocol(ProtocolDescriptor descriptor)
Create protocol with specified name

Parameters:
name - The protocol's name

Protocol

public Protocol()
Default constructor to create an empty protocol

Method Detail

setDescriptor

public void setDescriptor(ProtocolDescriptor descriptor)

getDescriptor

public ProtocolDescriptor getDescriptor()

addState

public void addState(State state)
Add a State to this Protocol

Parameters:
state - The to add

addTransition

public void addTransition(Transition transition)

getInitialState

public State getInitialState()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toDebuggingString

public java.lang.String toDebuggingString()

getStateByName

public State getStateByName(java.lang.String name)

getTransitions

public java.util.Set<Transition> getTransitions()
Retrieve the set of transitions associated with this protocol

Returns:

getStates

public java.util.Collection<State> getStates()

importsFrom

public boolean importsFrom(ProtocolDescriptor desc)

addImport

protected void addImport(ProtocolDescriptor desc)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

merge

public void merge(Protocol p)
Merge the states and transitions of the provided protocol into this one

Parameters:
p - The Protocol to be merged

initiates

public boolean initiates(IACREMessage m)