is.lill.acre.protocol
Class Transition

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

public class Transition
extends java.lang.Object


Field Summary
static java.lang.String CONTENT
           
static java.lang.String FROM_STATE
           
static java.lang.String PERFORMATIVE
           
static java.lang.String RECEIVER
           
static java.lang.String SENDER
           
static java.lang.String TO_STATE
           
 
Constructor Summary
Transition(State startState, State endState)
          Constructor
 
Method Summary
 ActiveTransition activate(Conversation c, Bindings b)
          Create a new Transition with the supplied bindings applied.
 Term getContent()
          Get the message content required to trigger this transition (including variables).
 State getEndState()
          Get the state that results from invoking this transition.
 java.lang.String getPerformative()
          Get the performative required in a message matching this transition.
 Term getReceiver()
           
 Term getSender()
          Find details of the agent required to send the message matching this Transition.
 State getStartState()
          Get the state that enables this transition to be invoked.
 boolean isTriggeredBy(IACREMessage message)
           
 void setContent(Term content)
          Specify the message content that would trigger this transition
 void setPerformative(java.lang.String performative)
          Set the performative required in a message matching this transition.
 void setReceiver(Term receiver)
           
 void setSender(Term sender)
          Set the name of the agent required to send the message matching this transition.
 java.lang.String toString()
          Create a String representation of this Transition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FROM_STATE

public static final java.lang.String FROM_STATE
See Also:
Constant Field Values

TO_STATE

public static final java.lang.String TO_STATE
See Also:
Constant Field Values

PERFORMATIVE

public static final java.lang.String PERFORMATIVE
See Also:
Constant Field Values

SENDER

public static final java.lang.String SENDER
See Also:
Constant Field Values

RECEIVER

public static final java.lang.String RECEIVER
See Also:
Constant Field Values

CONTENT

public static final java.lang.String CONTENT
See Also:
Constant Field Values
Constructor Detail

Transition

public Transition(State startState,
                  State endState)
Constructor

Parameters:
startState - State from which this transition can be invoked
endState - Resultant state from invoking this transition.
Method Detail

getStartState

public State getStartState()
Get the state that enables this transition to be invoked.

Returns:
An appropriate State object.

getEndState

public State getEndState()
Get the state that results from invoking this transition.

Returns:
An appropriate State object.

getPerformative

public java.lang.String getPerformative()
Get the performative required in a message matching this transition.

Returns:
The performative as a String.

setPerformative

public void setPerformative(java.lang.String performative)
Set the performative required in a message matching this transition.

Parameters:
performative - The performative as a String.

toString

public java.lang.String toString()
Create a String representation of this Transition.

Overrides:
toString in class java.lang.Object
Returns:
String

setSender

public void setSender(Term sender)
Set the name of the agent required to send the message matching this transition.

Parameters:
sender - The agent name that must match the sender in the message. May be parseable as a variable.

getSender

public Term getSender()
Find details of the agent required to send the message matching this Transition.

Returns:

setReceiver

public void setReceiver(Term receiver)

getReceiver

public Term getReceiver()

setContent

public void setContent(Term content)
Specify the message content that would trigger this transition

Parameters:
by - Message content (including variables)

getContent

public Term getContent()
Get the message content required to trigger this transition (including variables).

Returns:
Message content as an ITerm

activate

public ActiveTransition activate(Conversation c,
                                 Bindings b)
Create a new Transition with the supplied bindings applied. Has the effect of cloning this object and applying any relevant variable bindings.

Parameters:
bindings - Bindings to apply to this transition.
Returns:
An ActiveTransition based on this Transition with the given bindings applied.

isTriggeredBy

public boolean isTriggeredBy(IACREMessage message)