jdk/src/share/classes/java/time/chrono/IsoChronology.java
changeset 20519 eee7a92074fd
parent 19841 15c8e97d6a14
child 20794 ec823009c5f7
equal deleted inserted replaced
20518:dde564773845 20519:eee7a92074fd
    75 import java.time.DateTimeException;
    75 import java.time.DateTimeException;
    76 import java.time.Instant;
    76 import java.time.Instant;
    77 import java.time.LocalDate;
    77 import java.time.LocalDate;
    78 import java.time.LocalDateTime;
    78 import java.time.LocalDateTime;
    79 import java.time.Month;
    79 import java.time.Month;
       
    80 import java.time.Period;
    80 import java.time.Year;
    81 import java.time.Year;
    81 import java.time.ZoneId;
    82 import java.time.ZoneId;
    82 import java.time.ZonedDateTime;
    83 import java.time.ZonedDateTime;
    83 import java.time.format.ResolverStyle;
    84 import java.time.format.ResolverStyle;
    84 import java.time.temporal.ChronoField;
    85 import java.time.temporal.ChronoField;
   565         return field.range();
   566         return field.range();
   566     }
   567     }
   567 
   568 
   568     //-----------------------------------------------------------------------
   569     //-----------------------------------------------------------------------
   569     /**
   570     /**
       
   571      * Obtains a period for this chronology based on years, months and days.
       
   572      * <p>
       
   573      * This returns a period tied to the ISO chronology using the specified
       
   574      * years, months and days. See {@link Period} for further details.
       
   575      *
       
   576      * @param years  the number of years, may be negative
       
   577      * @param months  the number of years, may be negative
       
   578      * @param days  the number of years, may be negative
       
   579      * @return the period in terms of this chronology, not null
       
   580      * @return the ISO period, not null
       
   581      */
       
   582     @Override  // override with covariant return type
       
   583     public Period period(int years, int months, int days) {
       
   584         return Period.of(years, months, days);
       
   585     }
       
   586 
       
   587     //-----------------------------------------------------------------------
       
   588     /**
   570      * Writes the Chronology using a
   589      * Writes the Chronology using a
   571      * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
   590      * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
   572      * @serialData
   591      * @serialData
   573      * <pre>
   592      * <pre>
   574      *  out.writeByte(1);     // identifies a Chronology
   593      *  out.writeByte(1);     // identifies a Chronology