Ignore:
Timestamp:
2016-07-02T03:55:03+02:00 (9 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/CalibrationObject.java

    r29384 r32528  
     1// License: WTFPL. For details, see LICENSE file.
    12package iodb;
    23
    34import java.util.Map;
     5
    46import org.openstreetmap.josm.data.coor.LatLon;
    57import org.openstreetmap.josm.data.osm.Node;
     
    2830     * Initialize a calibration object from OSM primitive.
    2931     */
    30     public CalibrationObject( OsmPrimitive p ) {
    31         if( p instanceof Node )
    32             geometry = new LatLon[] { ((Node)p).getCoor() };
    33         else if( p instanceof Way ) {
    34             geometry = new LatLon[((Way)p).getNodesCount()];
    35             for( int i = 0; i < geometry.length; i++ )
    36                 geometry[i] = ((Way)p).getNode(i).getCoor();
     32    public CalibrationObject(OsmPrimitive p) {
     33        if (p instanceof Node)
     34            geometry = new LatLon[] {((Node) p).getCoor()};
     35        else if (p instanceof Way) {
     36            geometry = new LatLon[((Way) p).getNodesCount()];
     37            for (int i = 0; i < geometry.length; i++) {
     38                geometry[i] = ((Way) p).getNode(i).getCoor();
     39            }
    3740        } else
    3841            throw new IllegalArgumentException("Calibration Object can be created either from node or a way");
     
    4750
    4851    @Override
    49     public void putServerParams( Map<String, String> map ) {
     52    public void putServerParams(Map<String, String> map) {
    5053        super.putServerParams(map);
    5154        StringBuilder sb = new StringBuilder();
    52         for( int i = 0; i < geometry.length; i++ ) {
    53             if( i > 0 )
     55        for (int i = 0; i < geometry.length; i++) {
     56            if (i > 0)
    5457                sb.append(',');
    5558            sb.append(geometry[i].lon()).append(' ').append(geometry[i].lat());
     
    6063    @Override
    6164    public String toString() {
    62         return "CalibrationObject{" + geometry.length + "nodes; position=" + position + ", date=" + date + ", author=" + author + ", description=" + description + ", abandonDate=" + abandonDate + '}';
     65        return "CalibrationObject{" + geometry.length + "nodes; position=" + position + ", date=" + date + ", author=" + author +
     66                ", description=" + description + ", abandonDate=" + abandonDate + '}';
    6367    }
    6468}
Note: See TracChangeset for help on using the changeset viewer.