Package relaxngcc.automaton

# Class State

java.lang.Object
relaxngcc.automaton.State

All Implemented Interfaces:
  `Comparable`

public final class State extends Object implements Comparable
A State object has zero or more Transition objects

## Field Summary

Fields
Modifier and Type
Field
Description
`final Pattern`
`_locationHint`
Pattern from which this state was created.

## Constructor Summary

Constructors
Constructor
Description
`State(ScopeInfo container, int index, Pattern location)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionOnExit(ScopeInfo.Action act)`
`void`
`addActionsOnExit(ScopeInfo.Action[] act)`
`void`
`addTransition(Transition t)`
`Set`
`AFollow()`
`Set`
`attHead()`
Computes ATTHEAD set of this state and returns them in a sorted order.
`void`
`calcAFOLLOW()`
Computes AFOLLOW from this state.
`int`
`compareTo(Object obj)`
`Transition`
`findTransition(Alphabet a)`
finds a transition invoked by the passed alphabet
`ScopeInfo.Action[]`
`getActionsOnExit()`
`ScopeInfo`
`getContainer()`
`int`
`getIndex()`
`State[]`
`getReachableStates()`
Gets all the states reachable from this state.
`boolean`
`hasTransition(int alphabetTypes)`
Checks if this state has transitions with at least one of given types of alphabets.
`Set`
`head(boolean includeEE)`
Computes HEAD set of this state.
`boolean`
`isAcceptable()`
`Iterator`
`iterateTransitions()`
`Iterator`
`iterateTransitions(int alphabetTypes)`
Iterate transitions with specified alphabets.
`void`
`mergeTransitions(State s)`
`void`
`mergeTransitions(State s, ScopeInfo.Action action)`
For all the transitions leaving from the specified state, add it to this state by appending the specified action (possibly null) at the head of its prologue actions.
`void`
`outputActionsOnExit(CDBlock sv)`
Gets the code to invoke exit-actions.
`void`
`removeTransition(Transition t)`
`void`
`setAcceptable(boolean newvalue)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### _locationHint

public final Pattern _locationHint
Pattern from which this state was created.

## Constructor Details

### State

public State(ScopeInfo container, int index, Pattern location)

Parameters:
  `location` - Indicates the pattern object from which this state is created.

## Method Details

### setAcceptable

public void setAcceptable(boolean newvalue)

### isAcceptable

public boolean isAcceptable()

### getActionsOnExit

public ScopeInfo.Action[] getActionsOnExit()

### outputActionsOnExit

public void outputActionsOnExit(CDBlock sv)
Gets the code to invoke exit-actions.

### addActionOnExit

public void addActionOnExit(ScopeInfo.Action act)

### addActionsOnExit

public void addActionsOnExit(ScopeInfo.Action[] act)

### getContainer

public ScopeInfo getContainer()

### getIndex

public int getIndex()

### addTransition

public void addTransition(Transition t)

### removeTransition

public void removeTransition(Transition t)

### iterateTransitions

public Iterator iterateTransitions()

### hasTransition

public boolean hasTransition(int alphabetTypes)
Checks if this state has transitions with at least one of given types of alphabets.

Parameters:
  `alphabetTypes` - OR-ed combination of alphabet types you want to iterate.

### iterateTransitions

public Iterator iterateTransitions(int alphabetTypes)
Iterate transitions with specified alphabets.

Parameters:
  `alphabetTypes` - OR-ed combination of alphabet types you want to iterate.

### compareTo

public int compareTo(Object obj)

Specified by:
  `compareTo` in interface `Comparable`

### mergeTransitions

public void mergeTransitions(State s)

### mergeTransitions

public void mergeTransitions(State s, ScopeInfo.Action action)
For all the transitions leaving from the specified state, add it to this state by appending the specified action (possibly null) at the head of its prologue actions.

### findTransition

public Transition findTransition(Alphabet a)
finds a transition invoked by the passed alphabet

### getReachableStates

public State[] getReachableStates()
Gets all the states reachable from this state.

### head

public Set head(boolean includeEE)
Computes HEAD set of this state. See `Head` for the definition.

### attHead

public Set attHead()
Computes ATTHEAD set of this state and returns them in a sorted order. See
invalid reference

    HEAD

for the definition.

### AFollow

public Set AFollow()

### calcAFOLLOW

public void calcAFOLLOW()
Computes AFOLLOW from this state.