DFABuilder

class DFABuilder[S, T](init: S) extends DFABuilder[S, T, DFA, DFAelements[S, T], AutomatonStyle]

Concrete builder class for [[org.maraist.fa.DFA DFAs]] based on hash tables.

Type Params
S

The type of all states of the automaton

T

The type of labels on transitions of the automaton

Value members

Inherited methods

final
Inherited from
Growable
final
def +=(elem: DFAelements[S, T]): DFABuilder[S, T]
Inherited from
Growable
override
def accepts(string: Seq[T]): Boolean
Definition Classes
Inherited from
UnindexedDFA
Inherited from
Growable
override
Definition Classes
Inherited from
FABuilder
override
def addOne(elem: DFAelements[S, T]): DFABuilder[S, T]
Definition Classes
Inherited from
DFABuilder
def addState(s: S): Unit
Inherited from
StatesMixin
override
def addTransition(s1: S, t: T, s2: S): Unit
Definition Classes
Inherited from
DFABuilder
protected
def afterStatePlot(sb: StringBuilder, style: AutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int]): Unit
Inherited from
UnindexedFA
protected
def assemblePrettyTransition(before: Doc, arrow: Doc, after: Doc): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
override
def clear(): Unit

Clear this builder. When overriding this method, it is important to call super.clear().

Clear this builder. When overriding this method, it is important to call super.clear().

Definition Classes
Inherited from
FABuilder
override protected
Definition Classes
Inherited from
DFABuilder
Inherited from
DFABuilder
def dump(out: PrintStream): Unit
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
UnindexedDFA
protected
def edgeText(style: AutomatonStyle[S, T], si0: Int, s0: S, si1: Int, s1: S): String
Inherited from
UnindexedFA
protected
def edgeText(style: AutomatonStyle[S, T], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): String
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
FABuilder
protected
Inherited from
UnindexedFA
override
def foreachETransition(action: (S, S) => Unit { def apply(s1: S, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedDFA
override
def foreachFinalState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachInitialState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachTransition(action: (S, T, S) => Unit { def apply(s1: S, t: T, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def graphviz(sourceFile: String, outputFile: String)(using options: AutomatonStyle[S, T]): Unit

Use Graphviz to render this object as specified.

Use Graphviz to render this object as specified.

Inherited from
Graphable
def graphviz(fileRoot: String)(using options: AutomatonStyle[S, T]): Unit

Use Graphviz to render this object (in the default format) to the given file.

Use Graphviz to render this object (in the default format) to the given file.

Inherited from
Graphable
protected
def initPlot(sb: StringBuilder, states: Int, labels: Int): Unit
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
DFABuilder
override
Definition Classes
Inherited from
UnindexedDFA
protected
def internalsToDOT(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder)(using style: AutomatonStyle[S, T]): Unit

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Inherited from
UnindexedFA
override
Definition Classes
Inherited from
FABuilder
override
Definition Classes
Inherited from
DFABuilder
def isState(s: S): Boolean
Inherited from
StatesMixin
Inherited from
Growable
override
def labels: Set[T]
Definition Classes
Inherited from
DFABuilder
override
def map[S2, T2](stateMap: S => S2, transitionMap: T => T2): DFA[S2, T2]
Definition Classes
Inherited from
DFABuilder
def mapResult[NewTo](f: DFA[S, T] => NewTo): Builder[DFAelements[S, T], NewTo]
Inherited from
Builder
override
def mapStates[S2](stateMap: S => S2): DFA[S2, T]
Definition Classes
Inherited from
DFABuilder
override
def mapTransitions[T2](transitionMap: T => T2): DFA[S, T2]
Definition Classes
Inherited from
DFABuilder
protected

Add decorations for an initial state.

Add decorations for an initial state.

Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: AutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: AutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotState(sb: StringBuilder, style: AutomatonStyle[S, T], si: Int, s: S, isInitial: Boolean, isFinal: Boolean): Unit
Inherited from
UnindexedFA
protected
def plotTransitions(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder, style: AutomatonStyle[S, T]): Unit
Inherited from
UnindexedFA
def pretty: Doc
Inherited from
UnindexedFA
protected
def prettyETransition(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyETransitionArrow(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyFooter: Doc
Inherited from
UnindexedFA
override protected
def prettyHeader: Doc
Definition Classes
Inherited from
DFABuilder
protected
def prettyState(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateInTransition(state: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateLeader(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStates: Doc
Inherited from
UnindexedFA
protected
def prettyTransition(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyTransitionArrow(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
FABuilder
def removeState(s: S): Unit
Inherited from
StatesMixin
override
def removeTransition(s1: S, t: T): Unit
Definition Classes
Inherited from
DFABuilder
def result(): DFA[S, T]
Inherited from
DFABuilder
override
Definition Classes
Inherited from
DFABuilder
def size: Int
Inherited from
StatesMixin
final
def sizeHint(coll: IterableOnce[_], delta: Int): Unit
Inherited from
Builder
def sizeHint(size: Int): Unit
Inherited from
Builder
final
def sizeHintBounded(size: Int, boundingColl: Iterable[_]): Unit
Inherited from
Builder
def states: Set[S]
Inherited from
StatesMixin
override
def toDOT(using AutomatonStyle[S, T]): String
Definition Classes
UnindexedFA -> Graphable
Inherited from
UnindexedFA
override
def transition(s: S, t: T): Option[S]
Definition Classes
Inherited from
DFABuilder
override
Definition Classes
Inherited from
UnindexedFA
override
def transitions(s: S, t: T): Set[S]
Definition Classes
Inherited from
UnindexedDFA

Deprecated and Inherited methods

@inline @deprecated(message = "Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated", since = "2.13.0")
final
def +=(elem1: DFAelements[S, T], elem2: DFAelements[S, T], elems: DFAelements[S, T]*): DFABuilder[S, T]
Deprecated
[Since version 2.13.0] Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated
Inherited from
Growable

Inherited fields

protected

Storage for all state objects

Storage for all state objects

Inherited from
StatesMixin
protected

Storage for all final state objects.

Storage for all final state objects.

Inherited from
FABuilder
protected
Inherited from
DFABuilder
protected
Inherited from
DFABuilder