src/share/classes/java/text/SimpleDateFormat.java

Print this page




1770                 }
1771             }
1772             minutes += hours * 60;
1773             calb.set(Calendar.ZONE_OFFSET, minutes * MILLIS_PER_MINUTE * sign)
1774                 .set(Calendar.DST_OFFSET, 0);
1775             return index;
1776         } catch (IndexOutOfBoundsException e) {
1777         }
1778         return  1 - index; // -(index - 1)
1779     }
1780 
1781     private boolean isDigit(char c) {
1782         return c >= '0' && c <= '9';
1783     }
1784 
1785     /**
1786      * Private member function that converts the parsed date strings into
1787      * timeFields. Returns -start (for ParsePosition) if failed.
1788      * @param text the time text to be parsed.
1789      * @param start where to start parsing.
1790      * @param ch the pattern character for the date field text to be parsed.
1791      * @param count the count of a pattern character.
1792      * @param obeyCount if true, then the next field directly abuts this one,
1793      * and we should use the count to know when to stop parsing.
1794      * @param ambiguousYear return parameter; upon return, if ambiguousYear[0]
1795      * is true, then a two-digit year was parsed and may need to be readjusted.
1796      * @param origPos origPos.errorIndex is used to return an error index
1797      * at which a parse error occurred, if matching failure occurs.
1798      * @return the new start position if matching succeeded; -1 indicating
1799      * matching failure, otherwise. In case matching failure occurred,
1800      * an error index is set to origPos.errorIndex.
1801      */
1802     private int subParse(String text, int start, int patternCharIndex, int count,
1803                          boolean obeyCount, boolean[] ambiguousYear,
1804                          ParsePosition origPos,
1805                          boolean useFollowingMinusSignAsDelimiter, CalendarBuilder calb) {
1806         Number number = null;
1807         int value = 0;
1808         ParsePosition pos = new ParsePosition(0);
1809         pos.index = start;
1810         if (patternCharIndex == PATTERN_WEEK_YEAR && !calendar.isWeekDateSupported()) {




1770                 }
1771             }
1772             minutes += hours * 60;
1773             calb.set(Calendar.ZONE_OFFSET, minutes * MILLIS_PER_MINUTE * sign)
1774                 .set(Calendar.DST_OFFSET, 0);
1775             return index;
1776         } catch (IndexOutOfBoundsException e) {
1777         }
1778         return  1 - index; // -(index - 1)
1779     }
1780 
1781     private boolean isDigit(char c) {
1782         return c >= '0' && c <= '9';
1783     }
1784 
1785     /**
1786      * Private member function that converts the parsed date strings into
1787      * timeFields. Returns -start (for ParsePosition) if failed.
1788      * @param text the time text to be parsed.
1789      * @param start where to start parsing.
1790      * @param patternCharIndex the index of the pattern character.
1791      * @param count the count of a pattern character.
1792      * @param obeyCount if true, then the next field directly abuts this one,
1793      * and we should use the count to know when to stop parsing.
1794      * @param ambiguousYear return parameter; upon return, if ambiguousYear[0]
1795      * is true, then a two-digit year was parsed and may need to be readjusted.
1796      * @param origPos origPos.errorIndex is used to return an error index
1797      * at which a parse error occurred, if matching failure occurs.
1798      * @return the new start position if matching succeeded; -1 indicating
1799      * matching failure, otherwise. In case matching failure occurred,
1800      * an error index is set to origPos.errorIndex.
1801      */
1802     private int subParse(String text, int start, int patternCharIndex, int count,
1803                          boolean obeyCount, boolean[] ambiguousYear,
1804                          ParsePosition origPos,
1805                          boolean useFollowingMinusSignAsDelimiter, CalendarBuilder calb) {
1806         Number number = null;
1807         int value = 0;
1808         ParsePosition pos = new ParsePosition(0);
1809         pos.index = start;
1810         if (patternCharIndex == PATTERN_WEEK_YEAR && !calendar.isWeekDateSupported()) {