Java Code Examples for java.text.DateFormat#clone()
The following examples show how to use
java.text.DateFormat#clone() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: openstock File: PeriodAxisLabelInfo.java License: GNU General Public License v3.0 | 6 votes |
/** * Creates a new instance. * * @param periodClass the subclass of {@link RegularTimePeriod} to use * (<code>null</code> not permitted). * @param dateFormat the date format (<code>null</code> not permitted). * @param padding controls the space around the band (<code>null</code> * not permitted). * @param labelFont the label font (<code>null</code> not permitted). * @param labelPaint the label paint (<code>null</code> not permitted). * @param drawDividers a flag that controls whether dividers are drawn. * @param dividerStroke the stroke used to draw the dividers * (<code>null</code> not permitted). * @param dividerPaint the paint used to draw the dividers * (<code>null</code> not permitted). */ public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint) { ParamChecks.nullNotPermitted(periodClass, "periodClass"); ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(padding, "padding"); ParamChecks.nullNotPermitted(labelFont, "labelFont"); ParamChecks.nullNotPermitted(labelPaint, "labelPaint"); ParamChecks.nullNotPermitted(dividerStroke, "dividerStroke"); ParamChecks.nullNotPermitted(dividerPaint, "dividerPaint"); this.periodClass = periodClass; this.dateFormat = (DateFormat) dateFormat.clone(); this.padding = padding; this.labelFont = labelFont; this.labelPaint = labelPaint; this.drawDividers = drawDividers; this.dividerStroke = dividerStroke; this.dividerPaint = dividerPaint; }
Example 2
Source Project: lams File: SerializerProvider.java License: GNU General Public License v2.0 | 6 votes |
protected final DateFormat _dateFormat() { if (_dateFormat != null) { return _dateFormat; } /* At this point, all timezone configuration should have occurred, with respect * to default dateformat configuration. But we still better clone * an instance as formatters are stateful, not thread-safe. */ DateFormat df = _config.getDateFormat(); _dateFormat = df = (DateFormat) df.clone(); // [databind#939]: 26-Sep-2015, tatu: With 2.6, formatter has been (pre)configured // with TimeZone, so we should NOT try overriding it unlike with earlier versions /* TimeZone tz = getTimeZone(); if (tz != df.getTimeZone()) { df.setTimeZone(tz); } */ return df; }
Example 3
Source Project: ccu-historian File: PeriodAxisLabelInfo.java License: GNU General Public License v3.0 | 6 votes |
/** * Creates a new instance. * * @param periodClass the subclass of {@link RegularTimePeriod} to use * (<code>null</code> not permitted). * @param dateFormat the date format (<code>null</code> not permitted). * @param padding controls the space around the band (<code>null</code> * not permitted). * @param labelFont the label font (<code>null</code> not permitted). * @param labelPaint the label paint (<code>null</code> not permitted). * @param drawDividers a flag that controls whether dividers are drawn. * @param dividerStroke the stroke used to draw the dividers * (<code>null</code> not permitted). * @param dividerPaint the paint used to draw the dividers * (<code>null</code> not permitted). */ public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint) { ParamChecks.nullNotPermitted(periodClass, "periodClass"); ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(padding, "padding"); ParamChecks.nullNotPermitted(labelFont, "labelFont"); ParamChecks.nullNotPermitted(labelPaint, "labelPaint"); ParamChecks.nullNotPermitted(dividerStroke, "dividerStroke"); ParamChecks.nullNotPermitted(dividerPaint, "dividerPaint"); this.periodClass = periodClass; this.dateFormat = (DateFormat) dateFormat.clone(); this.padding = padding; this.labelFont = labelFont; this.labelPaint = labelPaint; this.drawDividers = drawDividers; this.dividerStroke = dividerStroke; this.dividerPaint = dividerPaint; }
Example 4
Source Project: SIMVA-SoS File: PeriodAxisLabelInfo.java License: Apache License 2.0 | 6 votes |
/** * Creates a new instance. * * @param periodClass the subclass of {@link RegularTimePeriod} to use * (<code>null</code> not permitted). * @param dateFormat the date format (<code>null</code> not permitted). * @param padding controls the space around the band (<code>null</code> * not permitted). * @param labelFont the label font (<code>null</code> not permitted). * @param labelPaint the label paint (<code>null</code> not permitted). * @param drawDividers a flag that controls whether dividers are drawn. * @param dividerStroke the stroke used to draw the dividers * (<code>null</code> not permitted). * @param dividerPaint the paint used to draw the dividers * (<code>null</code> not permitted). */ public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint) { ParamChecks.nullNotPermitted(periodClass, "periodClass"); ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(padding, "padding"); ParamChecks.nullNotPermitted(labelFont, "labelFont"); ParamChecks.nullNotPermitted(labelPaint, "labelPaint"); ParamChecks.nullNotPermitted(dividerStroke, "dividerStroke"); ParamChecks.nullNotPermitted(dividerPaint, "dividerPaint"); this.periodClass = periodClass; this.dateFormat = (DateFormat) dateFormat.clone(); this.padding = padding; this.labelFont = labelFont; this.labelPaint = labelPaint; this.drawDividers = drawDividers; this.dividerStroke = dividerStroke; this.dividerPaint = dividerPaint; }
Example 5
Source Project: ECG-Viewer File: PeriodAxisLabelInfo.java License: GNU General Public License v2.0 | 6 votes |
/** * Creates a new instance. * * @param periodClass the subclass of {@link RegularTimePeriod} to use * (<code>null</code> not permitted). * @param dateFormat the date format (<code>null</code> not permitted). * @param padding controls the space around the band (<code>null</code> * not permitted). * @param labelFont the label font (<code>null</code> not permitted). * @param labelPaint the label paint (<code>null</code> not permitted). * @param drawDividers a flag that controls whether dividers are drawn. * @param dividerStroke the stroke used to draw the dividers * (<code>null</code> not permitted). * @param dividerPaint the paint used to draw the dividers * (<code>null</code> not permitted). */ public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint) { ParamChecks.nullNotPermitted(periodClass, "periodClass"); ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(padding, "padding"); ParamChecks.nullNotPermitted(labelFont, "labelFont"); ParamChecks.nullNotPermitted(labelPaint, "labelPaint"); ParamChecks.nullNotPermitted(dividerStroke, "dividerStroke"); ParamChecks.nullNotPermitted(dividerPaint, "dividerPaint"); this.periodClass = periodClass; this.dateFormat = (DateFormat) dateFormat.clone(); this.padding = padding; this.labelFont = labelFont; this.labelPaint = labelPaint; this.drawDividers = drawDividers; this.dividerStroke = dividerStroke; this.dividerPaint = dividerPaint; }
Example 6
Source Project: astor File: TimeSeriesURLGenerator.java License: GNU General Public License v2.0 | 6 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { if (dateFormat == null) { throw new IllegalArgumentException("Null 'dateFormat' argument."); } if (prefix == null) { throw new IllegalArgumentException("Null 'prefix' argument."); } if (seriesParameterName == null) { throw new IllegalArgumentException( "Null 'seriesParameterName' argument."); } if (itemParameterName == null) { throw new IllegalArgumentException( "Null 'itemParameterName' argument."); } this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 7
Source Project: astor File: TimeSeriesURLGenerator.java License: GNU General Public License v2.0 | 6 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { if (dateFormat == null) { throw new IllegalArgumentException("Null 'dateFormat' argument."); } if (prefix == null) { throw new IllegalArgumentException("Null 'prefix' argument."); } if (seriesParameterName == null) { throw new IllegalArgumentException( "Null 'seriesParameterName' argument."); } if (itemParameterName == null) { throw new IllegalArgumentException( "Null 'itemParameterName' argument."); } this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 8
Source Project: buffer_bci File: PeriodAxisLabelInfo.java License: GNU General Public License v3.0 | 6 votes |
/** * Creates a new instance. * * @param periodClass the subclass of {@link RegularTimePeriod} to use * (<code>null</code> not permitted). * @param dateFormat the date format (<code>null</code> not permitted). * @param padding controls the space around the band (<code>null</code> * not permitted). * @param labelFont the label font (<code>null</code> not permitted). * @param labelPaint the label paint (<code>null</code> not permitted). * @param drawDividers a flag that controls whether dividers are drawn. * @param dividerStroke the stroke used to draw the dividers * (<code>null</code> not permitted). * @param dividerPaint the paint used to draw the dividers * (<code>null</code> not permitted). */ public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint) { ParamChecks.nullNotPermitted(periodClass, "periodClass"); ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(padding, "padding"); ParamChecks.nullNotPermitted(labelFont, "labelFont"); ParamChecks.nullNotPermitted(labelPaint, "labelPaint"); ParamChecks.nullNotPermitted(dividerStroke, "dividerStroke"); ParamChecks.nullNotPermitted(dividerPaint, "dividerPaint"); this.periodClass = periodClass; this.dateFormat = (DateFormat) dateFormat.clone(); this.padding = padding; this.labelFont = labelFont; this.labelPaint = labelPaint; this.drawDividers = drawDividers; this.dividerStroke = dividerStroke; this.dividerPaint = dividerPaint; }
Example 9
Source Project: buffer_bci File: PeriodAxisLabelInfo.java License: GNU General Public License v3.0 | 6 votes |
/** * Creates a new instance. * * @param periodClass the subclass of {@link RegularTimePeriod} to use * (<code>null</code> not permitted). * @param dateFormat the date format (<code>null</code> not permitted). * @param padding controls the space around the band (<code>null</code> * not permitted). * @param labelFont the label font (<code>null</code> not permitted). * @param labelPaint the label paint (<code>null</code> not permitted). * @param drawDividers a flag that controls whether dividers are drawn. * @param dividerStroke the stroke used to draw the dividers * (<code>null</code> not permitted). * @param dividerPaint the paint used to draw the dividers * (<code>null</code> not permitted). */ public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint) { ParamChecks.nullNotPermitted(periodClass, "periodClass"); ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(padding, "padding"); ParamChecks.nullNotPermitted(labelFont, "labelFont"); ParamChecks.nullNotPermitted(labelPaint, "labelPaint"); ParamChecks.nullNotPermitted(dividerStroke, "dividerStroke"); ParamChecks.nullNotPermitted(dividerPaint, "dividerPaint"); this.periodClass = periodClass; this.dateFormat = (DateFormat) dateFormat.clone(); this.padding = padding; this.labelFont = labelFont; this.labelPaint = labelPaint; this.drawDividers = drawDividers; this.dividerStroke = dividerStroke; this.dividerPaint = dividerPaint; }
Example 10
Source Project: openstock File: TimeSeriesURLGenerator.java License: GNU General Public License v3.0 | 5 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(prefix, "prefix"); ParamChecks.nullNotPermitted(seriesParameterName, "seriesParameterName"); ParamChecks.nullNotPermitted(itemParameterName, "itemParameterName"); this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 11
Source Project: lams File: DeserializationContext.java License: GNU General Public License v2.0 | 5 votes |
protected DateFormat getDateFormat() { if (_dateFormat != null) { return _dateFormat; } /* 24-Feb-2012, tatu: At this point, all timezone configuration * should have occurred, with respect to default dateformat * and timezone configuration. But we still better clone * an instance as formatters may be stateful. */ DateFormat df = _config.getDateFormat(); _dateFormat = df = (DateFormat) df.clone(); return df; }
Example 12
Source Project: ccu-historian File: TimeSeriesURLGenerator.java License: GNU General Public License v3.0 | 5 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(prefix, "prefix"); ParamChecks.nullNotPermitted(seriesParameterName, "seriesParameterName"); ParamChecks.nullNotPermitted(itemParameterName, "itemParameterName"); this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 13
Source Project: SIMVA-SoS File: TimeSeriesURLGenerator.java License: Apache License 2.0 | 5 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(prefix, "prefix"); ParamChecks.nullNotPermitted(seriesParameterName, "seriesParameterName"); ParamChecks.nullNotPermitted(itemParameterName, "itemParameterName"); this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 14
Source Project: ECG-Viewer File: TimeSeriesURLGenerator.java License: GNU General Public License v2.0 | 5 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(prefix, "prefix"); ParamChecks.nullNotPermitted(seriesParameterName, "seriesParameterName"); ParamChecks.nullNotPermitted(itemParameterName, "itemParameterName"); this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 15
Source Project: j2objc File: DateFormatTest.java License: Apache License 2.0 | 5 votes |
/** * @tests java.text.DateFormat#clone() */ public void test_clone() { DateFormat format = DateFormat.getInstance(); DateFormat clone = (DateFormat) format.clone(); assertTrue("Clone not equal", format.equals(clone)); clone.getNumberFormat().setMinimumFractionDigits(123); assertTrue("Clone shares NumberFormat", !format.equals(clone)); }
Example 16
Source Project: super-csv-annotation File: DateFormatWrapper.java License: Apache License 2.0 | 5 votes |
/** * フォーマッタを指定してインスタンスを作成するコンストラクタ。 * @param formatter 日時のフォーマッタ。 * @param type 対応する日時のクラス。 * @throws NullPointerException if formatter is null. */ public DateFormatWrapper(final DateFormat formatter, final Class<T> type) { Objects.requireNonNull(formatter); Objects.requireNonNull(type); this.formatter = (DateFormat) formatter.clone(); this.type = type; }
Example 17
Source Project: buffer_bci File: TimeSeriesURLGenerator.java License: GNU General Public License v3.0 | 5 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(prefix, "prefix"); ParamChecks.nullNotPermitted(seriesParameterName, "seriesParameterName"); ParamChecks.nullNotPermitted(itemParameterName, "itemParameterName"); this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }
Example 18
Source Project: buffer_bci File: TimeSeriesURLGenerator.java License: GNU General Public License v3.0 | 5 votes |
/** * Construct TimeSeriesURLGenerator overriding defaults. * * @param dateFormat a formatter for the date (<code>null</code> not * permitted). * @param prefix the prefix of the URL (<code>null</code> not permitted). * @param seriesParameterName the name of the series parameter in the URL * (<code>null</code> not permitted). * @param itemParameterName the name of the item parameter in the URL * (<code>null</code> not permitted). */ public TimeSeriesURLGenerator(DateFormat dateFormat, String prefix, String seriesParameterName, String itemParameterName) { ParamChecks.nullNotPermitted(dateFormat, "dateFormat"); ParamChecks.nullNotPermitted(prefix, "prefix"); ParamChecks.nullNotPermitted(seriesParameterName, "seriesParameterName"); ParamChecks.nullNotPermitted(itemParameterName, "itemParameterName"); this.dateFormat = (DateFormat) dateFormat.clone(); this.prefix = prefix; this.seriesParameterName = seriesParameterName; this.itemParameterName = itemParameterName; }