public static String GotoNextNonSpace(Vector inputVec,IntPair curLoc){
  boolean found=false;
  while ((!found) && curLoc.one < inputVec.size()) {
    String line=(String)inputVec.elementAt(curLoc.one);
    while ((!found) && curLoc.two < line.length()) {
      if (line.charAt(curLoc.two) == ' ') {
        curLoc.two++;
      }
 else {
        found=true;
      }
    }
    if (!found) {
      curLoc.one++;
      curLoc.two=0;
    }
  }
  if (curLoc.one < inputVec.size()) {
    return (String)inputVec.elementAt(curLoc.one);
  }
  return "";
}

public static String GotoNextNonSpace ( Vector inputVec , IntPair curLoc ) { boolean found = false ; while ( ( ! found ) && curLoc . one < inputVec . size ( ) ) { String line = ( String ) inputVec . elementAt ( curLoc . one ) ; while ( ( ! found ) && curLoc . two < line . length ( ) ) { if ( line . charAt ( curLoc . two ) == ' ' ) { curLoc . two ++ ; } else { found = true ; } } if ( ! found ) { curLoc . one ++ ; curLoc . two = 0 ; } } if ( curLoc . one < inputVec . size ( ) ) { return ( String ) inputVec . elementAt ( curLoc . one ) ; } return "" ; }
this method searches for the next non - space character and sets curloc to its location . if there is no non - space character found , then the location is set to column 0 of the first row after the end if inputvec . it returns the line to which curloc is pointing to , or " " if loc is after the end of the note : it does the right thing if loc is the column after the end of a row . see the comments above for an explanation of the arguments . ( no comment removal is possible . )
