de.ls5.jlearn.interfaces
Interface State

All Superinterfaces:
Serializable
All Known Implementing Classes:
StateImpl

public interface State
extends Serializable

A state of an Automaton.

Author:
merten

Method Summary
 Alphabet getAlphabet()
          Return the complete Alphabet to be considered at this state, including eventual local alphabet symbols.
 int getId()
          Retrieve the id of this state.
 Symbol[] getInputSymbols()
          Return all input-symbols for which a transition exists.
 Symbol getOutput()
          Return output-symbol associated with this state.
 Symbol[] getOutputSymbols()
          Return all output-symbols connected with existing transitions.
 Automaton getOwner()
          Return the Automaton this state is part of.
 State[] getSuccessorStates()
          Return all states reached by transitions of this state.
 Symbol getTransitionOutput(Symbol letter)
          Get output-symbol of the transition triggered by the supplied input-symbol
 State getTransitionState(Symbol letter)
          Get state the transition triggered by the supplied input-symbol leads to.
 boolean isWellDefined()
          Determine if for every Symbol of the input-Alphabet a transition exists.
 boolean setOutput(Symbol output)
          Set output-symbol for this state as e.g. used in Moore automata.
 boolean setTransition(Symbol input, State succ, Symbol output)
          Create a transition for a given input-symbol, leading into the supplied successor state and prodcing the supplied output-symbol.
 

Method Detail

getOwner

Automaton getOwner()
Return the Automaton this state is part of.

Returns:
Automaton this state is part of

isWellDefined

boolean isWellDefined()
Determine if for every Symbol of the input-Alphabet a transition exists.

Returns:
true if there is a transition for every input-symbol, false otherwise

getTransitionOutput

Symbol getTransitionOutput(Symbol letter)
Get output-symbol of the transition triggered by the supplied input-symbol

Parameters:
letter - input-symbol
Returns:
output-symbol for triggered transition

getTransitionState

State getTransitionState(Symbol letter)
Get state the transition triggered by the supplied input-symbol leads to.

Parameters:
letter - input-symbol
Returns:
state reached by triggered transition

getInputSymbols

Symbol[] getInputSymbols()
Return all input-symbols for which a transition exists.

Returns:
array of input-symbols

getOutputSymbols

Symbol[] getOutputSymbols()
Return all output-symbols connected with existing transitions.

Returns:
array of output-symbols

getSuccessorStates

State[] getSuccessorStates()
Return all states reached by transitions of this state.

Returns:
array of successor states.

setTransition

boolean setTransition(Symbol input,
                      State succ,
                      Symbol output)
Create a transition for a given input-symbol, leading into the supplied successor state and prodcing the supplied output-symbol.

Parameters:
input - input-symbol
succ - state the transition leads into
output - output-symbol produced by transition
Returns:
true if transition was created, false otherwise

setOutput

boolean setOutput(Symbol output)
Set output-symbol for this state as e.g. used in Moore automata.

Parameters:
output - output-symbol of this state
Returns:
true if output was set, false otherwise

getOutput

Symbol getOutput()
Return output-symbol associated with this state.

Returns:
output-symbol of this state

getAlphabet

Alphabet getAlphabet()
Return the complete Alphabet to be considered at this state, including eventual local alphabet symbols.

Returns:
Alphabet to be considered at this state

getId

int getId()
Retrieve the id of this state. The id is assigned by the Automaton upon creation of the state. Usually, the initial state will have id 0.

Returns:
assigned id of state


Copyright © 2011. All Rights Reserved.