Changeset 9861 in josm for trunk/src


Ignore:
Timestamp:
2016-02-23T21:01:34+01:00 (8 years ago)
Author:
simon04
Message:

Unit test, Javadoc for LatLon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r9796 r9861  
    205205
    206206    /**
    207      * Constructs a new {@link LatLon}
     207     * Constructs a new object representing the given latitude/longitude.
    208208     * @param lat the latitude, i.e., the north-south position in degrees
    209209     * @param lon the longitude, i.e., the east-west position in degrees
     
    217217    }
    218218
     219    /**
     220     * Constructs a new object for the given coordinate
     221     * @param coor the coordinate
     222     */
    219223    public LatLon(ICoordinate coor) {
    220224        this(coor.getLat(), coor.getLon());
     
    233237    public static final String NORTH = trc("compass", "N");
    234238
     239    /**
     240     * Formats the latitude part according to the given format
     241     * @param d the coordinate format to use
     242     * @return the formatted latitude
     243     */
    235244    public String latToString(CoordinateFormat d) {
    236245        switch(d) {
     
    254263    public static final String EAST = trc("compass", "E");
    255264
     265    /**
     266     * Formats the longitude part according to the given format
     267     * @param d the coordinate format to use
     268     * @return the formatted longitude
     269     */
    256270    public String lonToString(CoordinateFormat d) {
    257271        switch(d) {
     
    458472     *
    459473     * @return rounded value
    460      */
     474     * @deprecated Use {@link #roundToOsmPrecision(double)} instead
     475     */
     476    @Deprecated
    461477    public static double roundToOsmPrecisionStrict(double value) {
    462478        return roundToOsmPrecision(value);
     
    481497     *
    482498     * @return a clone of this lat LatLon
    483      */
     499     * @deprecated Use {@link #getRoundedToOsmPrecision()} instead
     500     */
     501    @Deprecated
    484502    public LatLon getRoundedToOsmPrecisionStrict() {
    485         return new LatLon(
    486                 roundToOsmPrecisionStrict(lat()),
    487                 roundToOsmPrecisionStrict(lon())
    488                 );
     503        return getRoundedToOsmPrecision();
    489504    }
    490505
     
    503518    }
    504519
     520    /**
     521     * Converts this latitude/longitude to an instance of {@link ICoordinate}.
     522     * @return a {@link ICoordinate} instance of this latitude/longitude
     523     */
    505524    public ICoordinate toCoordinate() {
    506525        return new org.openstreetmap.gui.jmapviewer.Coordinate(lat(), lon());
Note: See TracChangeset for help on using the changeset viewer.