code: public Number parse(String text, ParsePosition status) {
          // find the best number (defined as the one with the longest parse)
          int start = status.index;
          int furthest = start;
          double bestNumber = Double.NaN;
          double tempNumber = 0.0;
          for (int i = 0; i < choiceFormats.length; ++i) {
              String tempString = choiceFormats[i];
              if (text.regionMatches(start, tempString, 0, tempString.length())) {
                  status.index = start + tempString.length();
                  tempNumber = choiceLimits[i];
                  if (status.index > furthest) {
                      furthest = status.index;
                      bestNumber = tempNumber;
                      if (furthest == text.length()) break;
                  }
              }
          }
          status.index = furthest;
          if (status.index == start) {
              status.errorIndex = furthest;
          }
          return new Double(bestNumber);
      }
docs: Parses a Number from the input text.
  @param text the source text.
  @param status an input-output parameter.  On input, the
  status.index field indicates the first character of the
  source text that should be parsed.  On exit, if no error
  occured, status.index is set to the first unparsed character
  in the source text.  On exit, if an error did occur,
  status.index is unchanged and status.errorIndex is set to the
  first index of the character that caused the parse to fail.
  @return A Number representing the value of the number parsed.