class CellFormatterFactory {

    public CellFormatter getFormatter(ColumnType columnType, PreferencesRegistry preferencesRegistry)
    {
        CellFormatter formatter = myFormatterMap.get(columnType);
        if (formatter == null)
        {
            if (columnType == ColumnType.DOWN_TIMESTAMP || columnType == ColumnType.TIMESTAMP)
            {
                formatter = new DateTimeFormatter(preferencesRegistry);
            }
            else if (columnType == ColumnType.DATE || columnType == ColumnType.DOWN_DATE)
            {
                formatter = new DateFormatter(preferencesRegistry);
            }
            else if (columnType == ColumnType.TIME || columnType == ColumnType.DOWN_TIME)
            {
                formatter = new TimeFormatter(preferencesRegistry);
            }
            else if (columnType == ColumnType.LAT)
            {
                formatter = new LatitudeFormatter(preferencesRegistry);
            }
            else if (columnType == ColumnType.LON)
            {
                formatter = new LongitudeFormatter(preferencesRegistry);
            }
            else if (columnType == ColumnType.POSITION)
            {
                formatter = new PositionFormatter(preferencesRegistry);
            }
            else if (columnType == ColumnType.COLOR)
            {
                formatter = new ColorFormatter();
            }

            if (formatter != null)
            {
                myFormatterMap.put(columnType, formatter);
            }
        }
        return formatter;
    }

}