result.setMonth((short) number); hasNumber = false; } else {
result.setMonth((short)number); hasNumber = false; } else {
/** * Sets the value of the field associated with this descriptor. * @param target the object in which to set the value * @param value the value of the field */ public void setValue(Object target, Object value) throws java.lang.IllegalStateException { if (! (target instanceof Duration)) { String err = "DurationDescriptor#setValue: expected Duration, received instead: " + target.getClass(); throw new IllegalStateException(err); } Duration time = (Duration) target; if (value == null) { String err = "DurationDescriptor#setValue: null value"; throw new IllegalStateException(err); } //-- update current instance of time with new time try { Duration temp = Duration.parseDuration(value.toString()) ; time.setYear(temp.getYear()); time.setMonth(temp.getMonth()); time.setDay(temp.getDay()); time.setHour(temp.getHour()); time.setMinute(temp.getMinute()); time.setSeconds(temp.getSeconds()); time.setMilli(temp.getMilli()); } catch (java.text.ParseException ex) { throw new IllegalStateException(); } } //-- setValue
Duration temp = Duration.parseDuration(value.toString()); time.setYear(temp.getYear()); time.setMonth(temp.getMonth()); time.setDay(temp.getDay()); time.setHour(temp.getHour());
/** * Fill in the fields of the duration with the given values * * @param year the year value * @param month the month value * @param day the day value * @param hour the hour value * @param minute the minute value * @param second the second value * @param millisecond the second value */ public void setValue(short year, short month, short day, short hour, short minute, short second, long millisecond) { this.setYear(year); this.setMonth(month); this.setDay(day); this.setHour(hour); this.setMinute(minute); this.setSeconds(second); this.setMilli(millisecond); }
/** * Fill in the fields of the duration with the given values * @param year the year value * @param month the month value * @param day the day value * @param hour the hour value * @param minute the minute value * @param second the second value * @param millisecond the second value */ public void setValue(short year, short month, short day, short hour, short minute, short second, long millisecond) { this.setYear(year); this.setMonth(month); this.setDay(day); this.setHour(hour); this.setMinute(minute); this.setSeconds(second); this.setMilli(millisecond); }