public boolean nextStringEquals(String str) throws NoSuchElementException {
  int offset=mCurrentOffset;
  int length=advance();
  if (str.length() != length) {
    return false;
  }
  for (int i=0; i < str.length(); i++) {
    if (str.charAt(i) != mData[offset]) {
      return false;
    }
    offset++;
  }
  return true;
}

public boolean nextStringEquals ( String str ) throws NoSuchElementException { int offset = mCurrentOffset ; int length = advance ( ) ; if ( str . length ( ) != length ) { return false ; } for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) != mData [ offset ] ) { return false ; } offset ++ ; } return true ; }
matches the next token with a string .
