Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class State

    Automaton state.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    State
    Implements
    IComparable<State>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Util.Automaton
    Assembly: Lucene.Net.dll
    Syntax
    public class State : IComparable<State>

    Constructors

    State()

    Constructs a new state. Initially, the new state is a reject state.

    Declaration
    public State()

    Properties

    Accept

    Sets acceptance for this state. If true, this state is an accept state.

    Declaration
    public virtual bool Accept { get; set; }
    Property Value
    Type Description
    bool

    NumTransitions

    Automaton state.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public virtual int NumTransitions { get; }
    Property Value
    Type Description
    int

    Number

    Return this state's number.

    Expert: Will be useless unless GetNumberedStates() has been called first to number the states.
    Declaration
    public virtual int Number { get; }
    Property Value
    Type Description
    int

    The number.

    TransitionsArray

    Automaton state.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public Transition[] TransitionsArray { get; }
    Property Value
    Type Description
    Transition[]

    Methods

    AddTransition(Transition)

    Adds an outgoing transition.

    Declaration
    public virtual void AddTransition(Transition t)
    Parameters
    Type Name Description
    Transition t

    Transition.

    CompareTo(State)

    Compares this object with the specified object for order. States are ordered by the time of construction.

    Declaration
    public virtual int CompareTo(State s)
    Parameters
    Type Name Description
    State s
    Returns
    Type Description
    int

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()

    GetTransitions()

    Returns the set of outgoing transitions. Subsequent changes are reflected in the automaton.

    Declaration
    public virtual IEnumerable<Transition> GetTransitions()
    Returns
    Type Description
    IEnumerable<Transition>

    Transition set.

    Reduce()

    Reduces this state. A state is "reduced" by combining overlapping and adjacent edge intervals with same destination.

    Declaration
    public virtual void Reduce()

    SetTransitions(Transition[])

    Automaton state.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public virtual void SetTransitions(Transition[] transitions)
    Parameters
    Type Name Description
    Transition[] transitions

    SortTransitions(IComparer<Transition>)

    Returns sorted list of outgoing transitions.

    Declaration
    public virtual void SortTransitions(IComparer<Transition> comparer)
    Parameters
    Type Name Description
    IComparer<Transition> comparer

    Comparer to sort with.

    Step(int)

    Performs lookup in transitions, assuming determinism.

    Declaration
    public virtual State Step(int c)
    Parameters
    Type Name Description
    int c

    Codepoint to look up.

    Returns
    Type Description
    State

    Destination state, null if no matching outgoing transition.

    See Also
    Step(int, ICollection<State>)

    Step(int, ICollection<State>)

    Performs lookup in transitions, allowing nondeterminism.

    Declaration
    public virtual void Step(int c, ICollection<State> dest)
    Parameters
    Type Name Description
    int c

    Codepoint to look up.

    ICollection<State> dest

    Collection where destination states are stored.

    See Also
    Step(int)

    ToString()

    Returns string describing this state. Normally invoked via ToString().

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    TrimTransitionsArray()

    Downsizes transitionArray to numTransitions.

    Declaration
    public virtual void TrimTransitionsArray()

    Implements

    IComparable<T>
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.