public class IlvDecimalCoordinateFormatter extends IlvAbstractCoordinateFormatter
IlvDecimalCoordinateFormatter allows the user to enter
a decimal based latitude or longitude as degrees. For example,
12.521 33.435.
This implementation is based on the formatter returned by
NumberFormat.getInstance(java.util.Locale) .
Note: ellipsoid is not used in this implementation of
IlvCoordinateFormatter.
IlvCoordinateFormatter| Constructor and Description |
|---|
IlvDecimalCoordinateFormatter()
The default constructor.
|
IlvDecimalCoordinateFormatter(IlvInputStream stream)
Creates a new
IlvDecimalCoordinateFormatter from an
IlvInputStream. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Overrides deep comparison equals.
|
String |
getAngleString(double angleRad)
This method formats a single angle.
|
double |
getLatitude()
Returns the latitude of the current point.
|
String |
getLatitudeString()
Returns the latitude part of the formatted string.
|
double |
getLongitude()
Returns the longitude of the current point.
|
String |
getLongitudeString()
Returns the longitude part of the formatted string.
|
int |
hashCode() |
void |
parse(String coordinatesString)
Parses a formatted string containing a point's coordinates in this format.
|
void |
setLonLat(double longitude,
double latitude)
Sets the latitude and longitude of the current point.
|
protected void |
setupFormatters()
This method is called after precision has been changed and should update
the internal number formatters, if any.
|
String |
toString()
Returns the string representation of current point in this format.
|
getDecimalFormatSymbols, getEllipsoid, getInputSeparator, getOutputSeparator, getPrecision, setCoordinatePrecision, setEllipsoid, setOutputSeparator, setParseSeparator, setPrecision, writepublic IlvDecimalCoordinateFormatter()
public IlvDecimalCoordinateFormatter(IlvInputStream stream) throws IlvReadFileException
IlvDecimalCoordinateFormatter from an
IlvInputStream.stream - The input stream.IlvReadFileException - if an error occurs while reading.public double getLatitude()
throws IllegalStateException
IllegalStateException - if coordinates were not set first on the systemIlvCoordinateFormatter.getLatitude()public String getLatitudeString()
public double getLongitude()
throws IllegalStateException
IllegalStateException - if coordinates were not set first on the system.IlvCoordinateFormatter.getLongitude()public String getLongitudeString()
public void parse(String coordinatesString) throws IllegalArgumentException
coordinatesString - string containing coordinate information.IllegalArgumentException - if string format is not valid.IlvCoordinateFormatter.parse(java.lang.String)public void setLonLat(double longitude,
double latitude)
longitude - longitude in radians.latitude - latitude in radians.IlvCoordinateFormatter.setLonLat(double, double)public String toString()
toString in interface IlvCoordinateFormattertoString in class ObjectIlvCoordinateFormatter.toString()protected void setupFormatters()
setupFormatters in class IlvAbstractCoordinateFormatterIlvAbstractCoordinateFormatter.setupFormatters()public String getAngleString(double angleRad) throws UnsupportedOperationException
angleRad - angle in radians.UnsupportedOperationException - if the formatter does not support angles.IlvCoordinateFormatter.getAngleString(double)public int hashCode()
hashCode in class IlvAbstractCoordinateFormatterpublic boolean equals(Object other)
equals in class IlvAbstractCoordinateFormatterObject.equals(java.lang.Object)© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.