com.endeca.portal.format
Class GeocodeFormatter

java.lang.Object
  extended by com.endeca.portal.format.Formatter
      extended by com.endeca.portal.format.GeocodeFormatter
All Implemented Interfaces:
FormatSettings, GeocodeFormatSettings, java.io.Serializable

public class GeocodeFormatter
extends Formatter
implements GeocodeFormatSettings

Formatter for formatting Geocode type based on locale and format settings. If the value of a format setting is DEFAULT, the value of the format setting of its parent will be used if it is not DEFAULT. Otherwise, system default value of that format setting will be used.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.endeca.portal.format.Formatter
Formatter.FormatParseException
 
Nested classes/interfaces inherited from interface com.endeca.portal.format.GeocodeFormatSettings
GeocodeFormatSettings.DecimalPlacesMode
 
Nested classes/interfaces inherited from interface com.endeca.portal.format.FormatSettings
FormatSettings.Type
 
Field Summary
static int DEFAULT_DECIMAL_PLACES
           
static GeocodeFormatSettings.DecimalPlacesMode DEFAULT_DECIMAL_PLACES_MODE
           
 
Fields inherited from class com.endeca.portal.format.Formatter
parentFormatSettings, type
 
Constructor Summary
GeocodeFormatter()
           
 
Method Summary
protected  void clearCachedJavaFormat()
           
protected  void createJavaFormat()
           
 java.lang.String format(double latitude, double longitude)
           
 java.lang.String format(java.lang.String rawString)
           
protected  java.text.NumberFormat getCachedJavaFormat()
           
 int getDecimalPlaces()
           
 GeocodeFormatSettings.DecimalPlacesMode getDecimalPlacesMode()
           
 int getMergedDecimalPlaces()
           
 GeocodeFormatSettings.DecimalPlacesMode getMergedDecimalPlacesMode()
           
protected  void initializeJavaFormat()
           
protected  void localeChanged()
          Subclasses can override this method to clear/reset some cached data that is dependent on locale, for example cached Java format.
protected  void parentFormatSettingsChanged()
          Subclasses can override this method to clear/reset some cached data that is dependent on parent format settings, for example cached Java format.
 void setDecimalPlaces(int decimalPlaces)
           
 void setDecimalPlacesMode(GeocodeFormatSettings.DecimalPlacesMode decimalPlacesMode)
           
 
Methods inherited from class com.endeca.portal.format.Formatter
getLocale, getParentFormatSettings, getType, loadResources, setLocale, setLocale, setParentFormatSettings, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.endeca.portal.format.FormatSettings
getType, toString
 

Field Detail

DEFAULT_DECIMAL_PLACES_MODE

public static final GeocodeFormatSettings.DecimalPlacesMode DEFAULT_DECIMAL_PLACES_MODE

DEFAULT_DECIMAL_PLACES

public static final int DEFAULT_DECIMAL_PLACES
See Also:
Constant Field Values
Constructor Detail

GeocodeFormatter

public GeocodeFormatter()
Method Detail

getDecimalPlacesMode

public GeocodeFormatSettings.DecimalPlacesMode getDecimalPlacesMode()
Specified by:
getDecimalPlacesMode in interface GeocodeFormatSettings

setDecimalPlacesMode

public void setDecimalPlacesMode(GeocodeFormatSettings.DecimalPlacesMode decimalPlacesMode)

getMergedDecimalPlacesMode

public GeocodeFormatSettings.DecimalPlacesMode getMergedDecimalPlacesMode()
Specified by:
getMergedDecimalPlacesMode in interface GeocodeFormatSettings

getDecimalPlaces

public int getDecimalPlaces()
Specified by:
getDecimalPlaces in interface GeocodeFormatSettings

setDecimalPlaces

public void setDecimalPlaces(int decimalPlaces)

getMergedDecimalPlaces

public int getMergedDecimalPlaces()
Specified by:
getMergedDecimalPlaces in interface GeocodeFormatSettings

localeChanged

protected void localeChanged()
Description copied from class: Formatter
Subclasses can override this method to clear/reset some cached data that is dependent on locale, for example cached Java format.

Overrides:
localeChanged in class Formatter

parentFormatSettingsChanged

protected void parentFormatSettingsChanged()
Description copied from class: Formatter
Subclasses can override this method to clear/reset some cached data that is dependent on parent format settings, for example cached Java format.

Overrides:
parentFormatSettingsChanged in class Formatter

clearCachedJavaFormat

protected void clearCachedJavaFormat()

createJavaFormat

protected void createJavaFormat()

initializeJavaFormat

protected void initializeJavaFormat()

getCachedJavaFormat

protected java.text.NumberFormat getCachedJavaFormat()

format

public java.lang.String format(java.lang.String rawString)
                        throws Formatter.FormatParseException
Specified by:
format in class Formatter
Throws:
Formatter.FormatParseException

format

public java.lang.String format(double latitude,
                               double longitude)