dk.brics.automaton

## Class StringUnionOperations

- java.lang.Object
- - dk.brics.automaton.StringUnionOperations

-     public final class StringUnionOperations
      extends java.lang.Object

  Operations for building minimal deterministic automata from sets of strings. The algorithm requires sorted input data, but is very fast (nearly linear with the input size).
  Author:
    Dawid Weiss

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.Comparator<java.lang.CharSequence>` | `LEXICOGRAPHIC_ORDER` Lexicographic order of input sequences.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringUnionOperations()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(java.lang.CharSequence current)` Add another character sequence to this automaton.
    `static State` | `build(java.lang.CharSequence[] input)` Build a minimal, deterministic automaton from a sorted list of strings.
    `dk.brics.automaton.StringUnionOperations.State` | `complete()` Finalize the automaton and return the root state.

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

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

- - ### Field Detail

    - #### LEXICOGRAPHIC_ORDER

          public static final java.util.Comparator<java.lang.CharSequence> LEXICOGRAPHIC_ORDER

      Lexicographic order of input sequences.

  - ### Constructor Detail

    - #### StringUnionOperations

          public StringUnionOperations()

  - ### Method Detail

    - #### add

          public void add(java.lang.CharSequence current)

      Add another character sequence to this automaton. The sequence must be lexicographically larger or equal compared to any previous sequences added to this automaton (the input must be sorted).

    - #### complete

          public dk.brics.automaton.StringUnionOperations.State complete()

      Finalize the automaton and return the root state. No more strings can be added to the builder after this call.
      Returns:
        Root automaton state.

    - #### build

          public static State build(java.lang.CharSequence[] input)

      Build a minimal, deterministic automaton from a sorted list of strings.