Equals() 공개 메소드

public Equals ( object o ) : bool
o object
리턴 bool
예제 #1
0
        public List <DFAState> GetAnyDFAPathToTarget(DFAState startState, DFAState targetState, HashSet <DFAState> visited)
        {
            List <DFAState> dfaStates = new List <DFAState>();

            visited.Add(startState);
            if (startState.Equals(targetState))
            {
                dfaStates.Add(targetState);
                return(dfaStates);
            }
            // for (Edge e : startState.edges) { // walk edges looking for valid
            // path
            for (int i = 0; i < startState.NumberOfTransitions; i++)
            {
                Transition e = startState.GetTransition(i);
                if (!visited.Contains((DFAState)e.Target))
                {
                    List <DFAState> path = GetAnyDFAPathToTarget((DFAState)e.Target, targetState, visited);
                    if (path != null)
                    { // found path, we're done
                        dfaStates.Add(startState);
                        dfaStates.AddRange(path);
                        return(dfaStates);
                    }
                }
            }
            return(null);
        }
예제 #2
0
 public List<DFAState> GetAnyDFAPathToTarget(DFAState startState, DFAState targetState, HashSet<DFAState> visited)
 {
     List<DFAState> dfaStates = new List<DFAState>();
     visited.Add(startState);
     if (startState.Equals(targetState))
     {
         dfaStates.Add(targetState);
         return dfaStates;
     }
     // for (Edge e : startState.edges) { // walk edges looking for valid
     // path
     for (int i = 0; i < startState.NumberOfTransitions; i++)
     {
         Transition e = startState.GetTransition(i);
         if (!visited.Contains((DFAState)e.Target))
         {
             List<DFAState> path = GetAnyDFAPathToTarget((DFAState)e.Target, targetState, visited);
             if (path != null)
             { // found path, we're done
                 dfaStates.Add(startState);
                 dfaStates.AddRange(path);
                 return dfaStates;
             }
         }
     }
     return null;
 }