jdk/src/share/classes/java/time/Duration.java
changeset 21331 8ee181e7e48b
parent 20520 0952771e3e25
child 22081 86eb26ff8f2b
equal deleted inserted replaced
21327:9fc34e0b2a47 21331:8ee181e7e48b
   139      */
   139      */
   140     private static final BigInteger BI_NANOS_PER_SECOND = BigInteger.valueOf(NANOS_PER_SECOND);
   140     private static final BigInteger BI_NANOS_PER_SECOND = BigInteger.valueOf(NANOS_PER_SECOND);
   141     /**
   141     /**
   142      * The pattern for parsing.
   142      * The pattern for parsing.
   143      */
   143      */
   144     private final static Pattern PATTERN =
   144     private static final Pattern PATTERN =
   145             Pattern.compile("([-+]?)P(?:([-+]?[0-9]+)D)?" +
   145             Pattern.compile("([-+]?)P(?:([-+]?[0-9]+)D)?" +
   146                     "(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?",
   146                     "(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?",
   147                     Pattern.CASE_INSENSITIVE);
   147                     Pattern.CASE_INSENSITIVE);
   148 
   148 
   149     /**
   149     /**
   552      * Private class to delay initialization of this list until needed.
   552      * Private class to delay initialization of this list until needed.
   553      * The circular dependency between Duration and ChronoUnit prevents
   553      * The circular dependency between Duration and ChronoUnit prevents
   554      * the simple initialization in Duration.
   554      * the simple initialization in Duration.
   555      */
   555      */
   556     private static class DurationUnits {
   556     private static class DurationUnits {
   557         final static List<TemporalUnit> UNITS =
   557         static final List<TemporalUnit> UNITS =
   558                 Collections.unmodifiableList(Arrays.<TemporalUnit>asList(SECONDS, NANOS));
   558                 Collections.unmodifiableList(Arrays.<TemporalUnit>asList(SECONDS, NANOS));
   559     }
   559     }
   560 
   560 
   561     //-----------------------------------------------------------------------
   561     //-----------------------------------------------------------------------
   562     /**
   562     /**