src/main/java/de/dfki/lt/loot/fsa/FiniteAutomaton.java
protected void copyState(
      int state, FiniteAutomaton<EdgeInfo> copy,
      Map<Integer, Integer> stateMap) {

    for (Edge<EdgeInfo> oneOutEdge : this.getOutEdges(state)) {
      int targetState = oneOutEdge.getTarget();
      // if this state was already copied, there is an entry in the state map
      Integer targetStateCopy = stateMap.get(targetState);
      if (null == targetStateCopy) {
        targetStateCopy = copy.newVertex();
        stateMap.put(targetState, targetStateCopy);
        if (this.isFinalState(targetState)) {
          copy.setFinalState(targetStateCopy);
        }
        copyState(targetState, copy, stateMap);
      }
      copy.newEdge(
        oneOutEdge.getInfo(), stateMap.get(state), targetStateCopy);
    }
  }
/**
   * Recursively copies the given state and all states reachable from it to the
   * the given automaton copy
   *
   * @param state
   *          the start state
   * @param copy
   *          the automaton copy
   * @param stateMap
   *          a map of states of the original automaton to their equivalents
   *          in the new automaton
   */
Recursively copies the given state and all states reachable from it to the
the given automaton copy

@param state
the start state
@param copy
the automaton copy
@param stateMap
a map of states of the original automaton to their equivalents
in the new automaton
Recursively copies the given state and all states reachable from it to the the given automaton copy @param state the start state @param copy the automaton copy @param stateMap a map of states of the original automaton to their equivalents in the new automaton
protected void copyState(
      int state, FiniteAutomaton<EdgeInfo> copy,
      Map<Integer, Integer> stateMap) {
    for (Edge<EdgeInfo> oneOutEdge : this.getOutEdges(state)) {
      int targetState = oneOutEdge.getTarget();
      Integer targetStateCopy = stateMap.get(targetState);
      if (null == targetStateCopy) {
        targetStateCopy = copy.newVertex();
        stateMap.put(targetState, targetStateCopy);
        if (this.isFinalState(targetState)) {
          copy.setFinalState(targetStateCopy);
        }
        copyState(targetState, copy, stateMap);
      }
      copy.newEdge(
        oneOutEdge.getInfo(), stateMap.get(state), targetStateCopy);
    }
  }
protected void copyState ( int state , FiniteAutomaton < EdgeInfo > copy , Map < Integer , Integer > stateMap ) { for ( Edge < EdgeInfo > oneOutEdge : this . getOutEdges ( state ) ) { int targetState = oneOutEdge . getTarget ( ) ; Integer targetStateCopy = stateMap . get ( targetState ) ; if ( null == targetStateCopy ) { targetStateCopy = copy . newVertex ( ) ; stateMap . put ( targetState , targetStateCopy ) ; if ( this . isFinalState ( targetState ) ) { copy . setFinalState ( targetStateCopy ) ; } copyState ( targetState , copy , stateMap ) ; } copy . newEdge ( oneOutEdge . getInfo ( ) , stateMap . get ( state ) , targetStateCopy ) ; } }
Recursively copies the given state and all states reachable from it to the
 the given automaton copy
Recursively copies the given state and all states reachable from it to the the given automaton copy
// if this state was already copied, there is an entry in the state map