public static SimpleMDAGNode traverseMDAG ( SimpleMDAGNode [ ] mdagDataArray , SimpleMDAGNode sourceNode , String str ) { // char firstLetter = str.charAt(0); //Loop through the SimpleMDAGNodes in the processing MDAG's source node's _transition set, //searching for the the one with a letter (char) equal to the first char of str. //We can use that target node to _transition through the MDAG with the rest of the string return sourceNode . transition ( mdagDataArray , str . toCharArray ( ) ) ; // for(int i = 0; i < sourceNode.transitionSetSize; i++) // { // if(mdagDataArray[i].getLetter() == firstLetter) // return mdagDataArray[i]._transition(mdagDataArray, str.substring(1)); // } // ///// // // return null; }
Follows a _transition path starting from the source node of a MDAG .