Ignore:
Timestamp:
2014-09-07T16:33:52+02:00 (11 years ago)
Author:
stoecker
Message:

remove tabs

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Base64.java

    r7060 r7509  
    1717        // Hide default constructor for utils classes
    1818    }
    19    
     19
    2020    /** "base64": RFC 2045 default encoding */
    2121    private static String encDefault = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  • trunk/src/org/openstreetmap/josm/tools/GeoPropertyIndex.java

    r7353 r7509  
    77/**
    88 * Fast index to look up properties of the earth surface.
    9  * 
     9 *
    1010 * It is expected that there is a relatively slow method to look up the property
    1111 * for a certain coordinate and that there are larger areas with a uniform
    1212 * property.
    13  * 
     13 *
    1414 * This index tries to find rectangles with uniform property and caches them.
    1515 * Rectangles are subdivided, if there are different properties within.
    1616 * (Up to a maximum level, when the slow method is used again.)
    17  * 
     17 *
    1818 * @param <T> the property (like land/water or nation)
    1919 */
    2020public class GeoPropertyIndex<T> {
    21    
     21
    2222    /**
    2323     * A method to look up a property of the earth surface.
     
    4545    private final GPLevel<T> root;
    4646    private GPLevel<T> lastLevelUsed;
    47    
     47
    4848    private static final boolean DEBUG = false;
    4949
     
    5151     * Create new GeoPropertyIndex.
    5252     * @param geoProp the input property that should be made faster by this index
    53      * @param maxLevel 
     53     * @param maxLevel
    5454     */
    5555    public GeoPropertyIndex(GeoProperty<T> geoProp, int maxLevel) {
     
    5959        this.lastLevelUsed = root;
    6060    }
    61    
     61
    6262    /**
    6363     * Look up the property for a certain point.
     
    7070        return lastLevelUsed.get(ll);
    7171    }
    72    
     72
    7373    public static int index(LatLon ll, int level) {
    7474        long noParts = 1 << level;
     
    102102            return parent.get(ll);
    103103        }
    104        
     104
    105105        private T getBounded(LatLon ll) {
    106106            if (DEBUG) System.err.print("GPLevel["+level+"]"+bbox+" ");
     
    117117                return owner.geoProp.get(ll);
    118118            }
    119            
     119
    120120            if (children == null) {
    121121                @SuppressWarnings("unchecked")
     
    123123                this.children = tmp;
    124124            }
    125            
     125
    126126            int idx = index(ll, level+1);
    127127            if (children[idx] == null) {
    128128            double lon1, lat1;
    129129                switch (idx) {
    130                     case 0: 
     130                    case 0:
    131131                        lon1 = bbox.getTopLeftLon();
    132132                        lat1 = bbox.getBottomRightLat();
     
    136136                        lat1 = bbox.getTopLeftLat();
    137137                        break;
    138                     case 2: 
     138                    case 2:
    139139                        lon1 = bbox.getBottomRightLon();
    140140                        lat1 = bbox.getBottomRightLat();
    141141                        break;
    142                     case 3: 
     142                    case 3:
    143143                        lon1 = bbox.getBottomRightLon();
    144144                        lat1 = bbox.getTopLeftLat();
     
    154154            return children[idx].getBounded(ll);
    155155        }
    156        
     156
    157157        /**
    158158         * Checks, if a point is inside this tile.
     
    163163         */
    164164        boolean isInside(LatLon ll) {
    165             return bbox.getTopLeftLon() <= ll.lon() && 
    166                     (ll.lon() < bbox.getBottomRightLon() || (ll.lon() == 180.0 && bbox.getBottomRightLon() == 180.0)) && 
    167                     bbox.getBottomRightLat() <= ll.lat() && 
     165            return bbox.getTopLeftLon() <= ll.lon() &&
     166                    (ll.lon() < bbox.getBottomRightLon() || (ll.lon() == 180.0 && bbox.getBottomRightLon() == 180.0)) &&
     167                    bbox.getBottomRightLat() <= ll.lat() &&
    168168                    (ll.lat() < bbox.getTopLeftLat() || (ll.lat() == 90.0 && bbox.getTopLeftLat() == 90.0));
    169169        }
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r7392 r7509  
    469469        return new Area(path);
    470470    }
    471    
     471
    472472    /**
    473473     * Returns the Area of a polygon, from its list of nodes.
  • trunk/src/org/openstreetmap/josm/tools/InputMapUtils.java

    r6557 r7509  
    1717 */
    1818public final class InputMapUtils {
    19    
     19
    2020    private InputMapUtils() {
    2121        // Hide default constructor for utils classes
    2222    }
    23    
     23
    2424    /**
    2525     * Unassign Ctrl-Shift/Alt-Shift Up/Down from the given component
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r7012 r7509  
    55
    66public final class LanguageInfo {
    7    
     7
    88    private LanguageInfo() {
    99        // Hide default constructor for utils classes
    1010    }
    11    
     11
    1212    /**
    1313     * Type of the locale to use
     
    126126        return getJOSMLocaleCode()+".";
    127127    }
    128    
     128
    129129    public static String getLanguageCodeManifest() {
    130130        return getJOSMLocaleCode()+"_";
  • trunk/src/org/openstreetmap/josm/tools/Pair.java

    r7005 r7509  
    1010 */
    1111public final class Pair<A,B> {
    12    
     12
    1313    /**
    1414     * The first item
    1515     */
    1616    public A a;
    17    
     17
    1818    /**
    1919     * The second item
     
    6565
    6666    /**
    67      * Convenient constructor method 
     67     * Convenient constructor method
    6868     * @param u The first item
    6969     * @param v The second item
  • trunk/src/org/openstreetmap/josm/tools/Predicate.java

    r6452 r7509  
    99 */
    1010public interface Predicate<T> {
    11    
     11
    1212    /**
    1313     * Determines whether the object passes the test or not
  • trunk/src/org/openstreetmap/josm/tools/Property.java

    r6223 r7509  
    88 */
    99public interface Property<O, P> {
    10    
     10
    1111    /**
    1212     * Get the value of the property.
     
    1515     */
    1616    public P get(O obj);
    17    
     17
    1818    /**
    1919     * Set the value of the property for the object.
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r7248 r7509  
    2121 */
    2222public class RightAndLefthandTraffic {
    23    
     23
    2424    private static class RLTrafficGeoProperty implements GeoProperty<Boolean> {
    2525
     
    4646        }
    4747    }
    48    
     48
    4949    private static Collection<Area> leftHandTrafficPolygons;
    5050    private static GeoPropertyIndex<Boolean> rlCache;
     
    5252    /**
    5353     * Check if there is right-hand traffic at a certain location.
    54      * 
     54     *
    5555     * TODO: Synchronization can be refined inside the {@link GeoPropertyIndex}
    56      *       as most look-ups are read-only. 
     56     *       as most look-ups are read-only.
    5757     * @param ll the coordinates of the point
    5858     * @return true if there is right-hand traffic, false if there is left-hand traffic
     
    7777        rlCache = new GeoPropertyIndex<Boolean>(new RLTrafficGeoProperty(), 24);
    7878    }
    79    
     79
    8080}
Note: See TracChangeset for help on using the changeset viewer.