Class AbstractCoordinateFormat
- java.lang.Object
-
- org.openstreetmap.josm.data.coor.conversion.AbstractCoordinateFormat
-
- All Implemented Interfaces:
ICoordinateFormat
- Direct Known Subclasses:
DecimalDegreesCoordinateFormat
,DMSCoordinateFormat
,NauticalCoordinateFormat
,ProjectedCoordinateFormat
public abstract class AbstractCoordinateFormat extends Object implements ICoordinateFormat
Abstract base class forICoordinateFormat
implementations.- Since:
- 12735
-
-
Field Summary
Fields Modifier and Type Field Description protected static DecimalFormat
cDdFormatter
The normal number format for server precision coordinatesprotected String
displayName
protected static String
EAST
Character denoting East, as stringprotected String
id
protected static String
NORTH
Character denoting North, as stringprotected static String
SOUTH
Character denoting South, as stringprotected static String
WEST
Character denoting West, as string
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCoordinateFormat(String id, String displayName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDisplayName()
Get display name for this coordinate formatString
getId()
Get unique id for this coordinate format.static DecimalFormat
newUnlocalizedDecimalFormat(String pattern)
Creates a new unlocalizedDecimalFormat
.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat
latToString, lonToString, toString
-
-
-
-
Field Detail
-
displayName
protected final String displayName
-
cDdFormatter
protected static final DecimalFormat cDdFormatter
The normal number format for server precision coordinates
-
-
Constructor Detail
-
AbstractCoordinateFormat
protected AbstractCoordinateFormat(String id, String displayName)
-
-
Method Detail
-
newUnlocalizedDecimalFormat
public static DecimalFormat newUnlocalizedDecimalFormat(String pattern)
Creates a new unlocalizedDecimalFormat
. By not using the localized decimal separator, we can present a comma separated list of coordinates.- Parameters:
pattern
- decimal format pattern- Returns:
DecimalFormat
using dot as decimal separator- Since:
- 14203
- See Also:
DecimalFormat.applyPattern(String)
-
getId
public String getId()
Description copied from interface:ICoordinateFormat
Get unique id for this coordinate format.- Specified by:
getId
in interfaceICoordinateFormat
- Returns:
- unique id
-
getDisplayName
public String getDisplayName()
Description copied from interface:ICoordinateFormat
Get display name for this coordinate format- Specified by:
getDisplayName
in interfaceICoordinateFormat
- Returns:
- display name (localized)
-
-