src/main/java/de/dfki/lt/loot/fsa/FiniteAutomaton.java
public SubAutomaton concatenate(SubAutomaton lhs, SubAutomaton rhs) {

    // merge the final state of the first automaton with the initial state of
    // the second automaton:
    // all outgoing edges of the initial state of the second automaton must
    // start at the final state of the first automaton

    Iterator<Edge<EdgeInfo>> rhsOutEdges =
      _outEdges.get(rhs.getInitialState()).iterator();
    while (rhsOutEdges.hasNext()) {
      Edge<EdgeInfo> edge = rhsOutEdges.next();
      rhsOutEdges.remove();
      setFrom(edge, lhs.getFinalState());
    }
    // delete old initial state
    removeVertexLazy(rhs.getInitialState());
    // update final state
    lhs.setFinalState(rhs.getFinalState());

    // make sure rhs is empty now
    rhs.setInitialState(-1);
    rhs.setFinalState(-1);

    return lhs;
  }
/**
   * This concatenates the given automatons. The first automaton is modified so
   * that it contains the result automaton
   *
   * @param lhs a <code>FiniteAutomaton</code>
   * @param rhs a <code>FiniteAutomaton</code> to concatenate with lhs
   */
This concatenates the given automatons. The first automaton is modified so
that it contains the result automaton

@param lhs a FiniteAutomaton
@param rhs a FiniteAutomaton to concatenate with lhs
This concatenates the given automatons . The first automaton is modified so that it contains the result automaton @param lhs a FiniteAutomaton @param rhs a FiniteAutomaton to concatenate with lhs
public SubAutomaton concatenate(SubAutomaton lhs, SubAutomaton rhs) {
    Iterator<Edge<EdgeInfo>> rhsOutEdges =
      _outEdges.get(rhs.getInitialState()).iterator();
    while (rhsOutEdges.hasNext()) {
      Edge<EdgeInfo> edge = rhsOutEdges.next();
      rhsOutEdges.remove();
      setFrom(edge, lhs.getFinalState());
    }
    removeVertexLazy(rhs.getInitialState());
    lhs.setFinalState(rhs.getFinalState());
    rhs.setInitialState(-1);
    rhs.setFinalState(-1);
    return lhs;
  }
public SubAutomaton concatenate ( SubAutomaton lhs , SubAutomaton rhs ) { Iterator < Edge < EdgeInfo > > rhsOutEdges = _outEdges . get ( rhs . getInitialState ( ) ) . iterator ( ) ; while ( rhsOutEdges . hasNext ( ) ) { Edge < EdgeInfo > edge = rhsOutEdges . next ( ) ; rhsOutEdges . remove ( ) ; setFrom ( edge , lhs . getFinalState ( ) ) ; } removeVertexLazy ( rhs . getInitialState ( ) ) ; lhs . setFinalState ( rhs . getFinalState ( ) ) ; rhs . setInitialState ( - 1 ) ; rhs . setFinalState ( - 1 ) ; return lhs ; }
This concatenates the given automatons.
This concatenates the given automatons .
// merge the final state of the first automaton with the initial state of // the second automaton: // all outgoing edges of the initial state of the second automaton must // start at the final state of the first automaton // delete old initial state // update final state // make sure rhs is empty now