org.apache.shale.dialog.impl
Class DialogImpl

java.lang.Object
  extended by org.apache.shale.dialog.impl.DialogImpl
All Implemented Interfaces:
Dialog

public class DialogImpl
extends Object
implements Dialog

DialogImpl is a basic implementation of Dialog.

$Id: DialogImpl.java 419431 2006-07-06 04:38:39Z wsmoak $


Constructor Summary
DialogImpl()
           
 
Method Summary
 void addState(State state)
          Add the specified State to the States owned by this Dialog.
 void addTransition(Transition transition)
          Add the specified Transition to the global Transitions associated with this Dialog.
 State findState(String id)
          Return the specified State, owned by this Dialog, if any.
 Transition findTransition(String outcome)
          Return the global Transition for the specified logical outcome, if any; otherwise, return null.
 String getName()
          Return the name of this Dialog.
 String getStart()
          Return the name of the starting State for this Dialog.
 Iterator getStateIds()
          Return an Iterator over the names of States that are owned by this Dialog.
 Iterator getTransitionOutcomes()
          Return an Iterator over the logical outcomes of global Transitions for this Dialog.
 void removeState(State state)
          Remove the specified State from the States owned by this Dialog, if it is currently registered.
 void removeTransition(Transition transition)
          Remove the specified Transition from the global Transitions associated with this Dialog, if it is currently registered.
 void setName(String name)
          Set the name of this Dialog.
 void setStart(String start)
          Set the name of the starting State for this Dialog.
 String toString()
          Render a printable version of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DialogImpl

public DialogImpl()
Method Detail

getName

public String getName()

Return the name of this Dialog.

Specified by:
getName in interface Dialog

getStart

public String getStart()

Return the name of the starting State for this Dialog.

Specified by:
getStart in interface Dialog

getStateIds

public Iterator getStateIds()

Return an Iterator over the names of States that are owned by this Dialog. If there are no such States, an empty Iterator is returned.

Specified by:
getStateIds in interface Dialog

getTransitionOutcomes

public Iterator getTransitionOutcomes()

Return an Iterator over the logical outcomes of global Transitions for this Dialog. If there are no such Transitions, an empty Iterator is returned.

Specified by:
getTransitionOutcomes in interface Dialog

findState

public State findState(String id)

Return the specified State, owned by this Dialog, if any. Otherwise, return null.

Specified by:
findState in interface Dialog
Parameters:
id - Identifier of the requested State

findTransition

public Transition findTransition(String outcome)

Return the global Transition for the specified logical outcome, if any; otherwise, return null.

Specified by:
findTransition in interface Dialog
Parameters:
outcome - Logical outcome for which to return a Transition

toString

public String toString()

Render a printable version of this instance.

Overrides:
toString in class Object

addState

public void addState(State state)
              throws IllegalArgumentException

Add the specified State to the States owned by this Dialog.

Parameters:
state - State to be added
Throws:
IllegalArgumentException - if there is already a State with the specified id owned by this Dialog

addTransition

public void addTransition(Transition transition)
                   throws IllegalArgumentException

Add the specified Transition to the global Transitions associated with this Dialog.

Parameters:
transition - Transition to be added
Throws:
IllegalArgumentException - if the specified Transition cannot be added to this State

setName

public void setName(String name)

Set the name of this Dialog.

Parameters:
name - New name

setStart

public void setStart(String start)

Set the name of the starting State for this Dialog.

Parameters:
start - Name of the starting State

removeState

public void removeState(State state)

Remove the specified State from the States owned by this Dialog, if it is currently registered. Otherwise, do nothing.

Parameters:
state - State to be removed

removeTransition

public void removeTransition(Transition transition)

Remove the specified Transition from the global Transitions associated with this Dialog, if it is currently registered. Otherwise, do nothing.

Parameters:
transition - Transition to be removed


Copyright © 2004-2006 Apache Software Foundation. All Rights Reserved.