Java Date Format Pattern getFormatter(String pattern)

Here you can find the source of getFormatter(String pattern)

Description

get Formatter

License

Open Source License

Declaration

private static synchronized SimpleDateFormat getFormatter(String pattern) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.HashMap;

import java.util.Map;

public class Main {
    private static final Map<String, SimpleDateFormat> formatters = new HashMap<String, SimpleDateFormat>();

    private static synchronized SimpleDateFormat getFormatter(String pattern) {
        SimpleDateFormat sdf = null;
        if (formatters.containsKey(pattern)) {
            sdf = formatters.get(pattern);
        } else {// ww w .j a v a 2s. com
            sdf = new SimpleDateFormat(pattern);
            formatters.put(pattern, sdf);
        }
        return sdf;
    }
}

Related

  1. getFormatCurrentAdd(int amount, String format)
  2. getFormattedValue(Object customFieldValue)
  3. getFormatter()
  4. getFormatter()
  5. getFormatter(final String pattern)
  6. getFormatters()
  7. getFormatToSecsForFilename()
  8. getHeaderFormat()
  9. getLenientFormat(String format)