Example usage for java.text DecimalFormat clone

List of usage examples for java.text DecimalFormat clone

Introduction

In this page you can find the example usage for java.text DecimalFormat clone.

Prototype

@Override
public Object clone() 

Source Link

Document

Standard override; no change in semantics.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    format.setCurrency(Currency.getInstance(Locale.GERMANY));
    System.out.println(format.clone());

}

From source file:org.zuinnote.hadoop.office.format.common.converter.ExcelConverterSimpleSpreadSheetCellDAO.java

/***
 * Create a new converter//from  w  ww.  j  ava2 s. c om
 * 
 * @param dateFormat     format of the dates in the Excel. This format is cloned in the constructor to avoid inferences.
 * @param decimalFormat  format of the decimals in the Excel. This format is cloned in the constructor to avoid inferences.
 * @param dateTimeFormat format of date time cells in the Excel. This format is cloned in the constructor to avoid inferences.
 */
public ExcelConverterSimpleSpreadSheetCellDAO(SimpleDateFormat dateFormat, DecimalFormat decimalFormat,
        SimpleDateFormat dateTimeFormat) {
    this.schemaRow = new ArrayList<>();
    this.dateFormat = (SimpleDateFormat) dateFormat.clone();
    this.decimalFormat = (DecimalFormat) decimalFormat.clone();
    this.decimalFormat.setParseBigDecimal(true);
    if (dateTimeFormat != null) {
        this.dateTimeFormat = (SimpleDateFormat) dateTimeFormat.clone();
    }
}