jdk/src/share/classes/java/time/LocalTime.java
changeset 23597 d4ca7cc9c0c9
parent 22566 4ebe53dd7814
child 24256 da9a41004459
equal deleted inserted replaced
23596:ac4e06be5763 23597:d4ca7cc9c0c9
   836             f.checkValidValue(newValue);
   836             f.checkValidValue(newValue);
   837             switch (f) {
   837             switch (f) {
   838                 case NANO_OF_SECOND: return withNano((int) newValue);
   838                 case NANO_OF_SECOND: return withNano((int) newValue);
   839                 case NANO_OF_DAY: return LocalTime.ofNanoOfDay(newValue);
   839                 case NANO_OF_DAY: return LocalTime.ofNanoOfDay(newValue);
   840                 case MICRO_OF_SECOND: return withNano((int) newValue * 1000);
   840                 case MICRO_OF_SECOND: return withNano((int) newValue * 1000);
   841                 case MICRO_OF_DAY: return plusNanos((newValue - toNanoOfDay() / 1000) * 1000);
   841                 case MICRO_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000);
   842                 case MILLI_OF_SECOND: return withNano((int) newValue * 1000_000);
   842                 case MILLI_OF_SECOND: return withNano((int) newValue * 1000_000);
   843                 case MILLI_OF_DAY: return plusNanos((newValue - toNanoOfDay() / 1000_000) * 1000_000);
   843                 case MILLI_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000_000);
   844                 case SECOND_OF_MINUTE: return withSecond((int) newValue);
   844                 case SECOND_OF_MINUTE: return withSecond((int) newValue);
   845                 case SECOND_OF_DAY: return plusSeconds(newValue - toSecondOfDay());
   845                 case SECOND_OF_DAY: return plusSeconds(newValue - toSecondOfDay());
   846                 case MINUTE_OF_HOUR: return withMinute((int) newValue);
   846                 case MINUTE_OF_HOUR: return withMinute((int) newValue);
   847                 case MINUTE_OF_DAY: return plusMinutes(newValue - (hour * 60 + minute));
   847                 case MINUTE_OF_DAY: return plusMinutes(newValue - (hour * 60 + minute));
   848                 case HOUR_OF_AMPM: return plusHours(newValue - (hour % 12));
   848                 case HOUR_OF_AMPM: return plusHours(newValue - (hour % 12));