/** * Constructs a TS object with the given value. * The stored value will be in the following * format YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-ZZZZ] */ public CommonTS(String val) throws DataTypeException { this.setValue(val); } //end constructor
/** * Convenience setter which sets the value using a {@link Date} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the second * * @param theDate The date object from which to retrieve values * @since 1.1 */ public void setValueToSecond(Date theDate) throws DataTypeException { if (theDate == null) { setValue((String)null); return; } Calendar calendar = Calendar.getInstance(); calendar.setTime(theDate); setValueToSecond(calendar); }
/** * Convenience setter which sets the value using a {@link Date} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the minute * * @param theDate The date object from which to retrieve values * @since 1.1 */ public void setValueToMinute(Date theDate) throws DataTypeException { if (theDate == null) { setValue((String)null); return; } Calendar calendar = Calendar.getInstance(); calendar.setTime(theDate); setValueToMinute(calendar); }
/** * Constructs a TS object with the given value. * The stored value will be in the following * format YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-ZZZZ] */ public CommonTS(String val) throws DataTypeException { this.setValue(val); } //end constructor
/** * Convenience setter which sets the value using a {@link Date} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the second * * @param theDate The date object from which to retrieve values * @since 1.1 */ public void setValueToSecond(Date theDate) throws DataTypeException { if (theDate == null) { setValue((String)null); return; } Calendar calendar = Calendar.getInstance(); calendar.setTime(theDate); setValueToSecond(calendar); }
/** * Convenience setter which sets the value using a {@link Date} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the minute * * @param theDate The date object from which to retrieve values * @since 1.1 */ public void setValueToMinute(Date theDate) throws DataTypeException { if (theDate == null) { setValue((String)null); return; } Calendar calendar = Calendar.getInstance(); calendar.setTime(theDate); setValueToMinute(calendar); }
/** * Convenience setter which sets the value using a {@link Calendar} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the millisecond, and sets the timezone offset to * the current system offset * * @param theDate The calendar object from which to retrieve values * @since 1.1 */ public void setValue(Date theDate) throws DataTypeException { if (theDate == null) { setValue((String)null); return; } GregorianCalendar cal = new GregorianCalendar(); cal.setTime(theDate); setValue(cal); }
/** * Convenience setter which sets the value using a {@link Calendar} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the millisecond, and sets the timezone offset to * the current system offset * * @param theDate The calendar object from which to retrieve values * @since 1.1 */ public void setValue(Date theDate) throws DataTypeException { if (theDate == null) { setValue((String)null); return; } GregorianCalendar cal = new GregorianCalendar(); cal.setTime(theDate); setValue(cal); }
/** * @see AbstractPrimitive#setValue(java.lang.String) * @throws DataTypeException if the value is incorrectly formatted and either validation is * enabled for this primitive or detail setters / getters have been called, forcing further * parsing. */ public void setValue(String theValue) throws DataTypeException { super.setValue(theValue); if (myDetail != null) { myDetail.setValue(theValue); } }
/** * @see AbstractPrimitive#setValue(java.lang.String) * @throws DataTypeException if the value is incorrectly formatted and either validation is * enabled for this primitive or detail setters / getters have been called, forcing further * parsing. */ public void setValue(String theValue) throws DataTypeException { super.setValue(theValue); if (myDetail != null) { myDetail.setValue(theValue); } }
/** * Convenience setter which sets the value using a {@link Calendar} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the minute * * @param theCalendar The calendar object from which to retrieve values * @since 1.1 */ public void setValueToMinute(Calendar theCalendar) throws DataTypeException { if (theCalendar == null) { setValue((String)null); return; } int yr = theCalendar.get(Calendar.YEAR); int mnth = theCalendar.get(Calendar.MONTH) + 1; int dy = theCalendar.get(Calendar.DATE); int hr = theCalendar.get(Calendar.HOUR_OF_DAY); int min = theCalendar.get(Calendar.MINUTE); setDateMinutePrecision(yr, mnth, dy, hr, min); }
/** * Convenience setter which sets the value using a {@link Calendar} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the second * * @param theCalendar The calendar object from which to retrieve values * @since 1.1 */ public void setValueToSecond(Calendar theCalendar) throws DataTypeException { if (theCalendar == null) { setValue((String)null); return; } int yr = theCalendar.get(Calendar.YEAR); int mnth = theCalendar.get(Calendar.MONTH) + 1; int dy = theCalendar.get(Calendar.DATE); int hr = theCalendar.get(Calendar.HOUR_OF_DAY); int min = theCalendar.get(Calendar.MINUTE); int sec = theCalendar.get(Calendar.SECOND); setDateSecondPrecision(yr, mnth, dy, hr, min, sec); }
/** * Convenience setter which sets the value using a {@link Calendar} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the second * * @param theCalendar The calendar object from which to retrieve values * @since 1.1 */ public void setValueToSecond(Calendar theCalendar) throws DataTypeException { if (theCalendar == null) { setValue((String)null); return; } int yr = theCalendar.get(Calendar.YEAR); int mnth = theCalendar.get(Calendar.MONTH) + 1; int dy = theCalendar.get(Calendar.DATE); int hr = theCalendar.get(Calendar.HOUR_OF_DAY); int min = theCalendar.get(Calendar.MINUTE); int sec = theCalendar.get(Calendar.SECOND); setDateSecondPrecision(yr, mnth, dy, hr, min, sec); }
/** * Convenience setter which sets the value using a {@link Calendar} object. Passing in <code>null</code> clears any existing value. * * Note: Sets fields using precision up to the minute * * @param theCalendar The calendar object from which to retrieve values * @since 1.1 */ public void setValueToMinute(Calendar theCalendar) throws DataTypeException { if (theCalendar == null) { setValue((String)null); return; } int yr = theCalendar.get(Calendar.YEAR); int mnth = theCalendar.get(Calendar.MONTH) + 1; int dy = theCalendar.get(Calendar.DATE); int hr = theCalendar.get(Calendar.HOUR_OF_DAY); int min = theCalendar.get(Calendar.MINUTE); setDateMinutePrecision(yr, mnth, dy, hr, min); }
public static void main(String[] args) throws DataTypeException { CommonTS ts = new CommonTS(); ts.setValue("1984"); System.out.println(ts.getValue()); }
public static void main(String[] args) throws DataTypeException { CommonTS ts = new CommonTS(); ts.setValue("1984"); System.out.println(ts.getValue()); }
/** * Convenience setter which sets the value using a {@link Calendar} object. * * Note: Sets fields using precision up to the millisecond, including timezone offset * * @param theCalendar The calendar object from which to retrieve values * @since 1.1 */ public void setValue(Calendar theCalendar) throws DataTypeException { setValue((String)null); getDetail().setValue(theCalendar); }
/** * Convenience setter which sets the value using a {@link Calendar} object. * * Note: Sets fields using precision up to the millisecond, including timezone offset * * @param theCalendar The calendar object from which to retrieve values * @since 1.1 */ public void setValue(Calendar theCalendar) throws DataTypeException { setValue((String)null); getDetail().setValue(theCalendar); }
/** * Convenience setter which sets the value using a {@link Calendar} object. * * Note: Sets fields using precision up to the millisecond, and sets the timezone offset to * the current system offset * Note: Date is timezone-agnostic, representing always GMT time * * @param theDate The date object from which to retrieve values * @since 1.1 */ public void setValue(Date theDate) throws DataTypeException { setValue((String)null); getDetail().setValue(theDate); }
/** * Convenience setter which sets the value using a {@link Calendar} object. * * Note: Sets fields using precision up to the millisecond, and sets the timezone offset to * the current system offset * Note: Date is timezone-agnostic, representing always GMT time * * @param theDate The date object from which to retrieve values * @since 1.1 */ public void setValue(Date theDate) throws DataTypeException { setValue((String)null); getDetail().setValue(theDate); }