/** * Constructs a new Minute, based on the supplied date/time and timezone. * * @param time the time (<code>null</code> not permitted). * @param zone the time zone (<code>null</code> not permitted). * @param locale the locale (<code>null</code> not permitted). * * @since 1.0.13 */ public Minute(Date time, TimeZone zone, Locale locale) { if (time == null) { throw new IllegalArgumentException("Null 'time' argument."); } if (zone == null) { throw new IllegalArgumentException("Null 'zone' argument."); } if (locale == null) { throw new IllegalArgumentException("Null 'locale' argument."); } Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); int min = calendar.get(Calendar.MINUTE); this.minute = (byte) min; this.hour = (byte) calendar.get(Calendar.HOUR_OF_DAY); this.day = new Day(time, zone, locale); peg(calendar); }
/** * Constructs a new Minute. * * @param minute the minute (0 to 59). * @param hour the hour (<code>null</code> not permitted). */ public Minute(int minute, Hour hour) { if (hour == null) { throw new IllegalArgumentException("Null 'hour' argument."); } this.minute = (byte) minute; this.hour = (byte) hour.getHour(); this.day = hour.getDay(); peg(Calendar.getInstance()); }
/** * Constructs a new Minute. * * @param minute the minute (0 to 59). * @param hour the hour ({@code null} not permitted). */ public Minute(int minute, Hour hour) { Args.nullNotPermitted(hour, "hour"); this.minute = (byte) minute; this.hour = (byte) hour.getHour(); this.day = hour.getDay(); peg(Calendar.getInstance()); }
/** * Constructs a new Minute, based on the supplied date/time and timezone. * * @param time the time ({@code null} not permitted). * @param zone the time zone ({@code null} not permitted). * @param locale the locale ({@code null} not permitted). * * @since 1.0.13 */ public Minute(Date time, TimeZone zone, Locale locale) { Args.nullNotPermitted(time, "time"); Args.nullNotPermitted(zone, "zone"); Args.nullNotPermitted(locale, "locale"); Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); int min = calendar.get(Calendar.MINUTE); this.minute = (byte) min; this.hour = (byte) calendar.get(Calendar.HOUR_OF_DAY); this.day = new Day(time, zone, locale); peg(calendar); }