Ignore:
Timestamp:
2016-06-24T09:10:57+02:00 (10 years ago)
Author:
donvip
Message:

checkstyle, update to JOSM 10279

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/PublicTransportHelper.java

    r30841 r32395  
     1// License: GPL. For details, see LICENSE file.
    12package relcontext.actions;
    23
    3 import org.openstreetmap.josm.data.osm.Node;
    44import org.openstreetmap.josm.data.osm.OsmPrimitive;
    55import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    66import org.openstreetmap.josm.data.osm.RelationMember;
    7 import org.openstreetmap.josm.data.osm.Way;
    87
    98/**
     
    2625    public final static String BUS_STOP = "bus_stop";
    2726    public final static String RAILWAY_HALT = "halt";
    28     public final static String RAILWAY_STATION = "station";   
    29    
     27    public final static String RAILWAY_STATION = "station";
     28
    3029    private PublicTransportHelper() {
    3130        // Hide default constructor for utils classes
    32     }       
    33    
     31    }
     32
    3433    public static String getRoleByMember(RelationMember m) {
    3534        if (isMemberStop(m)) return STOP;
     
    3736        return null;
    3837    }
    39    
     38
    4039    public static boolean isMemberStop(RelationMember m) {
    4140        return isNodeStop(m);   // stop is only node
    4241    }
    43    
     42
    4443    public static boolean isMemberPlatform(RelationMember m) {
    4544        return isNodePlatform(m) || isWayPlatform(m);
    4645    }
    47    
     46
    4847    public static boolean isNodeStop(RelationMember m) {
    4948        return isNodeStop(m.getMember());
    5049    }
    51    
     50
    5251    public static boolean isNodeStop(OsmPrimitive p) {
    5352        if (p.getType() == OsmPrimitiveType.NODE && !p.isIncomplete()) {
     
    6362        return false;
    6463    }
    65    
     64
    6665    public static boolean isNodePlatform(RelationMember m) {
    6766        return isNodePlatform(m.getMember());
    6867    }
    69    
     68
    7069    public static boolean isNodePlatform(OsmPrimitive p) {
    7170        if (p.getType() == OsmPrimitiveType.NODE && !p.isIncomplete()) {
     
    8786        return isWayPlatform(m.getMember());
    8887    }
    89    
     88
    9089    public static boolean isWayPlatform(OsmPrimitive p) {
    9190        if (p.getType() == OsmPrimitiveType.WAY && !p.isIncomplete()) {
     
    103102        return false;
    104103    }
    105    
     104
    106105    public static boolean isMemberRouteway(RelationMember m) {
    107106        return isWayRouteway(m.getMember());
    108107    }
    109    
     108
    110109    public static boolean isWayRouteway(OsmPrimitive p) {
    111         if (p.getType() == OsmPrimitiveType.WAY && !p.isIncomplete()) {
     110        if (p.getType() == OsmPrimitiveType.WAY && !p.isIncomplete())
    112111            return p.hasKey(HIGHWAY) || p.hasKey(RAILWAY);
    113         }
    114112        return false;
    115113    }
    116    
     114
    117115    public static String getNameViaStoparea(RelationMember m) {
    118116        return getNameViaStoparea(m.getMember());
    119117    }
    120    
     118
    121119    public static String getNameViaStoparea(OsmPrimitive prim) {
    122120        String result = prim.getName();
     
    125123        for (OsmPrimitive refOp : prim.getReferrers())
    126124            if (refOp.getType() == OsmPrimitiveType.RELATION
    127                 && refOp.hasTag(PUBLIC_TRANSPORT, STOP_AREA)) {
     125            && refOp.hasTag(PUBLIC_TRANSPORT, STOP_AREA)) {
    128126                result = refOp.getName();
    129127                if (result != null) return result;
    130128            }
    131129        return result;
    132     }   
     130    }
    133131}
Note: See TracChangeset for help on using the changeset viewer.