private Integer getFieldValue(int theField) { if (getValue() == null) { return null; } Calendar cal = getValueAsCalendar(); return cal.get(theField); }
private void setFieldValue(int theField, int theValue, String theFractionalSeconds, int theMinimum, int theMaximum) { validateValueInRange(theValue, theMinimum, theMaximum); Calendar cal; if (getValue() == null) { cal = new GregorianCalendar(0, 0, 0); } else { cal = getValueAsCalendar(); } if (theField != -1) { cal.set(theField, theValue); } if (theFractionalSeconds != null) { myFractionalSeconds = theFractionalSeconds; } else if (theField == Calendar.MILLISECOND) { myFractionalSeconds = StringUtils.leftPad(Integer.toString(theValue), 3, '0'); } super.setValue(cal.getTime()); }
private Integer getFieldValue(int theField) { if (getValue() == null) { return null; } Calendar cal = getValueAsCalendar(); return cal.get(theField); }
private void setFieldValue(int theField, int theValue, String theFractionalSeconds, int theMinimum, int theMaximum) { validateValueInRange(theValue, theMinimum, theMaximum); Calendar cal; if (getValue() == null) { cal = new GregorianCalendar(0, 0, 0); } else { cal = getValueAsCalendar(); } if (theField != -1) { cal.set(theField, theValue); } if (theFractionalSeconds != null) { myFractionalSeconds = theFractionalSeconds; } else if (theField == Calendar.MILLISECOND) { myFractionalSeconds = StringUtils.leftPad(Integer.toString(theValue), 3, '0'); } super.setValue(cal.getTime()); }