Changeset 6500 in josm


Ignore:
Timestamp:
2013-12-19T20:56:10+01:00 (11 years ago)
Author:
simon04
Message:

Add Javadoc for LatLon, add unit tests for LatLonDialog (parsing)

Location:
trunk
Files:
1 added
2 edited

Legend:

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

    r6380 r6500  
    2121/**
    2222 * LatLon are unprojected latitude / longitude coordinates.
    23  *
     23 * <br>
     24 * <b>Latitude</b> specifies the north-south position in degrees
     25 * where valid values are in the [-90,90] and positive values specify positions north of the equator.
     26 * <br>
     27 * <b>Longitude</b> specifies the east-west position in degrees
     28 * where valid values are in the [-180,180] and positive values specify positions east of the prime meridian.
     29 * <br>
     30 * <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Latitude_and_Longitude_of_the_Earth.svg/500px-Latitude_and_Longitude_of_the_Earth.svg.png">
     31 * <br>
    2432 * This class is immutable.
    2533 *
     
    4149     */
    4250    public static final LatLon ZERO = new LatLon(0, 0);
    43    
     51
    4452    private static DecimalFormat cDmsMinuteFormatter = new DecimalFormat("00");
    4553    private static DecimalFormat cDmsSecondFormatter = new DecimalFormat("00.0");
     
    160168    }
    161169
     170    /**
     171     * Constructs a new {@link LatLon}
     172     * @param lat the latitude, i.e., the north-south position in degrees
     173     * @param lon the longitude, i.e., the east-west position in degrees
     174     */
    162175    public LatLon(double lat, double lon) {
    163176        super(lon, lat);
     
    168181    }
    169182
     183    /**
     184     * Returns the latitude, i.e., the north-south position in degrees.
     185     * @return the latitude
     186     */
    170187    public double lat() {
    171188        return y;
     
    184201    }
    185202
     203    /**
     204     * Returns the longitude, i.e., the east-west position in degrees.
     205     * @return the longitude
     206     */
    186207    public double lon() {
    187208        return x;
     
    229250    /**
    230251     * Check if this is contained in given area or area is null.
    231      * 
     252     *
    232253     * @param a Area
    233254     * @return <code>true</code> if this is contained in given area or area is null.
     
    304325    /**
    305326     * Returns the euclidean distance from this {@code LatLon} to a specified {@code LatLon}.
    306      * 
     327     *
    307328     * @param ll the specified coordinate to be measured against this {@code LatLon}
    308329     * @return the euclidean distance from this {@code LatLon} to a specified {@code LatLon}
     
    315336    /**
    316337     * Returns the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon}.
    317      * 
     338     *
    318339     * @param ll the specified coordinate to be measured against this {@code LatLon}
    319340     * @return the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

    r6361 r6500  
    340340    }
    341341
    342     private static LatLon parseLatLon(final String coord) {
     342    public static LatLon parseLatLon(final String coord) {
    343343        final Matcher m = p.matcher(coord);
    344344
     
    423423    }
    424424
    425     private static EastNorth parseEastNorth(String s) {
     425    public static EastNorth parseEastNorth(String s) {
    426426        String[] en = s.split("[;, ]+");
    427427        if (en.length != 2) return null;
Note: See TracChangeset for help on using the changeset viewer.