Changeset 32970 in osm


Ignore:
Timestamp:
2016-09-10T17:31:55+02:00 (8 years ago)
Author:
donvip
Message:

checkstyle

Location:
applications/editors/josm/plugins/FixAddresses
Files:
3 added
40 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FixAddresses/.project

    r32286 r32970  
    2626                        </arguments>
    2727                </buildCommand>
     28                <buildCommand>
     29                        <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
     30                        <arguments>
     31                        </arguments>
     32                </buildCommand>
    2833        </buildSpec>
    2934        <natures>
    3035                <nature>org.eclipse.jdt.core.javanature</nature>
     36                <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
    3137        </natures>
    3238</projectDescription>
  • applications/editors/josm/plugins/FixAddresses/.settings/org.eclipse.jdt.core.prefs

    r32699 r32970  
    33org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
    44org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     5org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
    56org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     7org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
    68org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     9org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
    710org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    811org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
     
    8588org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
    8689org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     90org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
    8791org.eclipse.jdt.core.compiler.problem.unusedImport=warning
    8892org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java

    r32771 r32970  
    4040 * {@see AddressEditTableModel}
    4141 *
    42  * @author Oliver Wieland <oliver.wieland@online.de>
     42 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    4343 *
    4444 */
     
    9696    /**
    9797     * Adds a change listener.
    98      * @param listener
     98     * @param listener change listener
    9999     */
    100100    public void addChangedListener(IAddressEditContainerListener listener) {
     
    104104    /**
    105105     * Removes a change listener.
    106      * @param listener
     106     * @param listener change listener
    107107     */
    108108    public void removeChangedListener(IAddressEditContainerListener listener) {
     
    305305
    306306    /**
    307      * Gets the dictionary contains the collected streets.
    308      * @return
     307     * Gets the dictionary containing the collected streets.
     308     * @return dictionary containing the collected streets
    309309     */
    310310    public HashMap<String, OSMStreet> getStreetDict() {
     
    343343    /**
    344344     * Gets all addresses without valid street.
    345      * @return
     345     * @return all addresses without valid street
    346346     */
    347347    public List<OSMAddress> getUnresolvedItems() {
     
    351351    /**
    352352     * Gets the tags used in the data layer.
    353      * @return
     353     * @return the tags used in the data layer
    354354     */
    355355    public HashSet<String> getTags() {
     
    366366    /**
    367367     * Gets the number of streets in the container.
    368      * @return
     368     * @return the number of streets in the container
    369369     */
    370370    public int getNumberOfStreets() {
     
    374374    /**
    375375     * Get the number of incomplete addresses.
    376      * @return
     376     * @return the number of incomplete addresses
    377377     */
    378378    public int getNumberOfIncompleteAddresses() {
     
    382382    /**
    383383     * Gets the number of unresolved addresses.
    384      * @return
     384     * @return the number of unresolved addresses
    385385     */
    386386    public int getNumberOfUnresolvedAddresses() {
     
    399399    /**
    400400     * Gets the number of guessed tags.
    401      * @return
     401     * @return the number of guessed tags
    402402     */
    403403    public int getNumberOfGuesses() {
     
    414414    /**
    415415     * Gets all (incomplete and/or unresolved) address nodes to fix.
    416      * @return
     416     * @return all (incomplete and/or unresolved) address nodes to fix
    417417     */
    418418    public List<OSMAddress> getAllAddressesToFix() {
     
    444444    /**
    445445     * Tries to assign an address to a street.
    446      * @param aNode
     446     * @param aNode address
    447447     */
    448448    private boolean assignAddressToStreet(OSMAddress aNode) {
     
    716716         * @param score Score of the street (length of longest common substring)
    717717         */
    718         public StreetScore(String name, int score) {
     718        StreetScore(String name, int score) {
    719719            super();
    720720            this.name = name;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressProblem.java

    r30737 r32970  
    9999    @Override
    100100    public void removeSolution(ISolution solution) {
    101         if (solutions == null ) throw new RuntimeException("Solution list is null");
     101        if (solutions == null) throw new RuntimeException("Solution list is null");
    102102        if (solutions.size() == 0) throw new RuntimeException("Solution list is empty");
    103103
     
    110110        return source;
    111111    }
    112 
    113112}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java

    r32771 r32970  
    1313import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1414
    15 public class FixAddressesPreferences extends DefaultTabPreferenceSetting {
     15public final class FixAddressesPreferences extends DefaultTabPreferenceSetting {
    1616    private static final String FIX_ADDRESSES_IGNORE_POST_CODE_KEY = "fixAddresses.ignorePostCode";
    1717    private static final String FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY = "fixAddresses.selectGuessedObjects";
    18    
     18
    1919    private JCheckBox cbSelectGuessedObjects = new JCheckBox(tr("Include objects used for guesses"));
    2020    private JCheckBox cbIgnorePostCode = new JCheckBox();
     
    2222    /**
    2323     * Internal factory class. Call <code>FixAddressesPreferences.Factory().createPreferenceSetting()</code> to
    24      * create the preference setting instance. 
     24     * create the preference setting instance.
    2525     */
    2626    public static class Factory implements PreferenceSettingFactory {
     
    3030        }
    3131    }
    32    
     32
    3333    /**
    3434     * Internal constructor.
     
    3737        loadFromPrefs();
    3838    }
    39    
     39
    4040    /**
    4141     * Loads the (initial) preference settings.
     
    4545        setIgnorePostCode(Main.pref.getBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, false));
    4646    }
    47    
     47
    4848    /**
    4949     * Save the preference settings.
     
    9292     * Checks if invalid post codes should be ignored. If yes, post codes are neither
    9393     * checked for existence nor for correctness.
    94      * @return
     94     * @return {@code true} if invalid post codes should be ignored
    9595     */
    9696    public boolean isIgnorePostCode() {
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java

    r32771 r32970  
    1919 * instance of {@link AddressEditDialog}.
    2020 *
    21  * @author Oliver Wieland <oliver.wieland@online.de>
     21 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    2222 */
    2323@SuppressWarnings("serial")
     
    7676        for (String tag : addrVisitor.getTags()) {
    7777            String methodName = createMethodName(tag);
    78             System.out
    79             .println(String
    80                     .format(
    81                             "/** Check if OSM primitive has a tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static boolean has%sTag(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.hasKey(%s_TAG) : false;\n}\n",
    82                             tag, methodName, tag.toUpperCase()
    83                             .replaceAll(":", "_")));
    84             System.out
    85             .println(String
    86                     .format(
    87                             "/** Gets the value of tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static String get%sValue(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.get(%s_TAG) : null;\n}\n",
    88                             tag, methodName, tag.toUpperCase()
    89                             .replaceAll(":", "_")));
     78            // CHECKSTYLE.OFF: LineLength
     79            System.out.println(String.format(
     80                "/** Check if OSM primitive has a tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static boolean has%sTag(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.hasKey(%s_TAG) : false;\n}\n",
     81                tag, methodName, tag.toUpperCase()
     82                .replaceAll(":", "_")));
     83            System.out.println(String.format(
     84                "/** Gets the value of tag '%s'.\n * @param osmPrimitive The OSM entity to check.*/\npublic static String get%sValue(OsmPrimitive osmPrimitive) {\n return osmPrimitive != null ? osmPrimitive.get(%s_TAG) : null;\n}\n",
     85                tag, methodName, tag.toUpperCase()
     86                .replaceAll(":", "_")));
     87            // CHECKSTYLE.ON: LineLength
    9088        }
    9189
     
    102100            String values = value.toUpperCase().replaceAll(":", "_");
    103101            System.out.println(String.format(
    104                     "public static final String %s_%s_VALUE = \"%s\";", tags, values
    105                     , value));
     102                    "public static final String %s_%s_VALUE = \"%s\";", tags, values, value));
    106103        }
    107104    }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessAddressRunnable.java

    r32771 r32970  
    2929    private boolean canceled;
    3030
    31     private GuessedValueHandler[] wayGuessers = new GuessedValueHandler[]{new GuessStreetValueHandler(TagUtils.ADDR_STREET_TAG)};
     31    private GuessedValueHandler[] wayGuessers = new GuessedValueHandler[]{new GuessStreetValueHandler(TagConstants.ADDR_STREET_TAG)};
    3232    private GuessedValueHandler[] nodeGuessers = new GuessedValueHandler[]{
    33             new GuessedValueHandler(TagUtils.ADDR_POSTCODE_TAG, 500.0),
    34             new GuessedValueHandler(TagUtils.ADDR_CITY_TAG, 5000.0),
    35             new GuessedValueHandler(TagUtils.ADDR_STATE_TAG, 5000.0),
    36             new GuessedValueHandler(TagUtils.ADDR_COUNTRY_TAG, 5000.0),
    37             new GuessedValueHandler(TagUtils.ADDR_CITY_TAG, 2000.0)
     33            new GuessedValueHandler(TagConstants.ADDR_POSTCODE_TAG, 500.0),
     34            new GuessedValueHandler(TagConstants.ADDR_CITY_TAG, 5000.0),
     35            new GuessedValueHandler(TagConstants.ADDR_STATE_TAG, 5000.0),
     36            new GuessedValueHandler(TagConstants.ADDR_COUNTRY_TAG, 5000.0),
     37            new GuessedValueHandler(TagConstants.ADDR_CITY_TAG, 2000.0)
    3838    };
    3939
     
    6969        return addressesToGuess;
    7070    }
     71
    7172    /**
    7273     * @return the isRunning
     
    194195    }
    195196
    196     // TODO: Put in separate file
    197197    private static class GuessStreetValueHandler extends GuessedValueHandler {
    198         public GuessStreetValueHandler(String tag) {
     198        GuessStreetValueHandler(String tag) {
    199199            this(tag, null);
    200200        }
    201201
    202         public GuessStreetValueHandler(String tag, OSMAddress aNode) {
     202        GuessStreetValueHandler(String tag, OSMAddress aNode) {
    203203            super(tag, aNode, 200.0);
    204204        }
     
    222222                        currentValue = newVal;
    223223                        srcNode = w;
    224                         //aNode.setGuessedValue(getTag(), currentValue, w);
    225                     } else {
    226                         //System.out.println(String.format("Skipped %s: %4.2f m", TagUtils.getNameValue(w), dist));
    227224                    }
    228225                }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java

    r30348 r32970  
    3636        this(tag, null, DEFAULT_MAX_DIST);
    3737    }
    38    
     38
    3939    /**
    4040     * Instantiates a new guessed value handler without node.
     
    4646        this(tag, null, maxDist);
    4747    }
    48    
     48
    4949    /**
    5050     * Instantiates a new guessed value handler.
     
    7575            maxDist = 1.0;
    7676        }
    77        
     77
    7878        this.tag = tag;
    7979        this.maxDist = maxDist;
    80         setAddressNode(aNode);       
     80        setAddressNode(aNode);
    8181    }
    8282
     
    8989        return aNode;
    9090    }
    91    
     91
    9292
    9393    /**
    9494     * Sets the address node to make the guess for.
    95      * @param aNode
     95     * @param aNode address node
    9696     */
    97     public void setAddressNode(OSMAddress aNode) {       
     97    public void setAddressNode(OSMAddress aNode) {
    9898        this.aNode = aNode;
    9999        // reset search results
    100100        minDist = Double.MAX_VALUE;
    101101        srcNode = null;
    102         currentValue = null;       
     102        currentValue = null;
    103103    }
    104104
     
    140140        return currentValue;
    141141    }
    142    
    143    
     142
     143
    144144    /**
    145145     * Gets the node/way which has been selected for the guess.
     
    162162    public void visit(Node n) {
    163163        assert aNode != null;
    164        
     164
    165165        if (n.hasKey(tag)) {
    166166            double dist = n.getCoor().greatCircleDistance(aNode.getCoor());
     
    176176    public void visit(Way w) {
    177177        assert aNode != null;
    178        
     178
    179179        if (w.hasKey(tag)) {
    180180            double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w);
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java

    r30348 r32970  
    55    /**
    66     * Notifies clients that the container has been changed.
    7      * @param container
     7     * @param container container
    88     */
    9     public void containerChanged(AddressEditContainer container);
     9    void containerChanged(AddressEditContainer container);
    1010
    1111    /**
    1212     * Notifies clients that an entity has been changed.
    1313     */
    14     public void entityChanged(IOSMEntity node);
     14    void entityChanged(IOSMEntity node);
    1515}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAllKnowingTrashHeap.java

    r30348 r32970  
    1313     * @return the closest street names
    1414     */
    15     public List<String> getClosestStreetNames(String name, int maxEntries);
     15    List<String> getClosestStreetNames(String name, int maxEntries);
    1616
    1717    /**
     
    2121     * @return the closest street name
    2222     */
    23     public String getClosestStreetName(String name);
     23    String getClosestStreetName(String name);
    2424
    2525    /**
     
    2929     * @return true, if street name is valid; otherwise false.
    3030     */
    31     public boolean isValidStreetName(String name);
     31    boolean isValidStreetName(String name);
    3232}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java

    r30348 r32970  
    1111     * @param command The command instance to process by the enclosing command listener.
    1212     */
    13     public void commandIssued(IOSMEntity entity, Command command);
     13    void commandIssued(IOSMEntity entity, Command command);
    1414}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java

    r32771 r32970  
    1010 * Base interface for all node entities. A node entity is a lightweight wrapper
    1111 * around OSM objects in order to ease up some tasks like tag handling.
    12  * @author Oliver Wieland <oliver.wieland@online.de>
    13  *
     12 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    1413 */
    1514public interface IOSMEntity extends Comparable<IOSMEntity> {
    1615    /**
    1716     * Gets the underlying OSM object.
    18      * @return
     17     * @return the underlying OSM object
    1918     */
    20     public OsmPrimitive getOsmObject();
     19    OsmPrimitive getOsmObject();
    2120
    2221    /**
    2322     * Checks if underlying OSM object has a name.
    24      * @return
     23     * @return {@code true} if underlying OSM object has a name
    2524     */
    26     public boolean hasName();
     25    boolean hasName();
    2726
    2827    /**
    2928     * Gets the name of the entity node.
    30      * @return
     29     * @return the name of the entity node
    3130     */
    32     public String getName();
     31    String getName();
    3332
    3433    /**
    3534     * Gets the children of the entity node.
    36      * @return
     35     * @return the children of the entity node
    3736     */
    38     public List<IOSMEntity> getChildren();
     37    List<IOSMEntity> getChildren();
    3938
    4039    /**
     
    4241     * node, it just returns the node coordinate. For ways and areas, this
    4342     * method returns the coordinate of the center (balance point).
    44      * @return
     43     * @return the coordinate of the node
    4544     */
    46     public LatLon getCoor();
     45    LatLon getCoor();
    4746
    4847    /**
    4948     * Adds a command listener.
    50      * @param listener
     49     * @param listener command listener
    5150     */
    52     public void addCommandListener(ICommandListener listener);
     51    void addCommandListener(ICommandListener listener);
    5352
    5453    /**
    5554     * Removes a command listener.
    56      * @param listener
     55     * @param listener command listener
    5756     */
    58     public void removeCommandListener(ICommandListener listener);
     57    void removeCommandListener(ICommandListener listener);
    5958
    6059    /**
     
    6463     * @param visitor the problem visitor
    6564     */
    66     public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor);
     65    void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor);
    6766
    6867    @Override
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblem.java

    r30348 r32970  
    1111     * @return the source
    1212     */
    13     public IOSMEntity getSource();
     13    IOSMEntity getSource();
    1414
    1515    /**
     
    1818     * @return the description
    1919     */
    20     public String getDescription();
     20    String getDescription();
    2121
    2222    /**
     
    2525     * @return the type
    2626     */
    27     public ProblemType getType();
     27    ProblemType getType();
    2828
    2929    /**
     
    3232     * @return the solutions
    3333     */
    34     public List<ISolution> getSolutions();
     34    List<ISolution> getSolutions();
    3535
    3636    /**
     
    3939     * @param solution the solution
    4040     */
    41     public void addSolution(ISolution solution);
     41    void addSolution(ISolution solution);
    4242
    4343    /**
     
    4646     * @param solution the solution
    4747     */
    48     public void removeSolution(ISolution solution);
     48    void removeSolution(ISolution solution);
    4949
    5050    /**
    5151     * Removes all solutions from this problem.
    5252     */
    53     public void clearSolutions();
     53    void clearSolutions();
    5454
    5555    /**
     
    5858     * @param solution the solution
    5959     */
    60     public void applySolution(ISolution solution);
     60    void applySolution(ISolution solution);
    6161}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblemVisitor.java

    r30348 r32970  
    88     * @param problem the problem to add
    99     */
    10     public void addProblem(IProblem problem);
     10    void addProblem(IProblem problem);
    1111
    1212    /**
    1313     * Removes the problems of the given source.
    1414     */
    15     public void removeProblemsOfSource(IOSMEntity entity);
     15    void removeProblemsOfSource(IOSMEntity entity);
    1616}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProgressMonitorFinishedListener.java

    r30348 r32970  
    33
    44public interface IProgressMonitorFinishedListener {
    5     public void finished();
     5    void finished();
    66}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ISolution.java

    r30348 r32970  
    1111     * @return the description
    1212     */
    13     public String getDescription();
     13    String getDescription();
    1414
    1515    /**
     
    1818     * @return the action
    1919     */
    20     public JosmAction getAction();
     20    JosmAction getAction();
    2121
    2222    /**
     
    2525     * @return the type
    2626     */
    27     public SolutionType getType();
     27    SolutionType getType();
    2828
    2929    /**
    3030     * Executes one or more actions to solve a problem.
    3131     */
    32     public void solve();
     32    void solve();
    3333}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMAddress.java

    r30737 r32970  
    3434
    3535    public OSMAddress(OsmPrimitive osmObject) {
    36     super(osmObject);
     36        super(osmObject);
    3737    }
    3838
    3939    @Override
    4040    public void setOsmObject(OsmPrimitive osmObject) {
    41     super.setOsmObject(osmObject);
    42 
    43     isPartOfInterpolation = OsmUtils
    44         .getValuesFromAddressInterpolation(this);
    45     isPartOfAssocStreetRel = OsmUtils.getValuesFromRelation(this);
     41        super.setOsmObject(osmObject);
     42
     43        isPartOfInterpolation = OsmUtils.getValuesFromAddressInterpolation(this);
     44        isPartOfAssocStreetRel = OsmUtils.getValuesFromRelation(this);
    4645    }
    4746
     
    5049     * describe an address.
    5150     *
    52      * @return
     51     * @return {@code true} if the underlying address node has all tags usually needed to describe an address
    5352     */
    5453    public boolean isComplete() {
    55     boolean isComplete = hasCity() && hasHouseNumber() && hasCity()
    56         && hasStreetName();
    57 
    58     // Check, if "addr:state" is required (US and AU)
    59     if (TagUtils.isStateRequired()) {
    60         isComplete = isComplete && hasState();
    61     }
    62 
    63     // Check, if user checked "ignore post code"
    64     if (!FixAddressesPlugin.getPreferences().isIgnorePostCode()) {
    65         isComplete = isComplete && hasPostalCode()
    66             && PostalCodeChecker.hasValidPostalCode(this);
    67     }
    68 
    69     return isComplete;
     54        boolean isComplete = hasCity() && hasHouseNumber() && hasCity() && hasStreetName();
     55
     56        // Check, if "addr:state" is required (US and AU)
     57        if (TagUtils.isStateRequired()) {
     58            isComplete = isComplete && hasState();
     59        }
     60
     61        // Check, if user checked "ignore post code"
     62        if (!FixAddressesPlugin.getPreferences().isIgnorePostCode()) {
     63            isComplete = isComplete && hasPostalCode()
     64                && PostalCodeChecker.hasValidPostalCode(this);
     65        }
     66
     67        return isComplete;
    7068    }
    7169
     
    7371     * Gets the name of the street associated with this address.
    7472     *
    75      * @return
     73     * @return the name of the street associated with this address
    7674     */
    7775    public String getStreetName() {
    78     return getTagValueWithGuess(TagUtils.ADDR_STREET_TAG);
     76        return getTagValueWithGuess(TagConstants.ADDR_STREET_TAG);
    7977    }
    8078
     
    8987     */
    9088    private String getTagValueWithGuess(String tag) {
    91     if (StringUtils.isNullOrEmpty(tag))
    92         return MISSING_TAG;
    93     if (osmObject == null)
    94         return MISSING_TAG;
    95 
    96     if (!osmObject.hasKey(tag)
    97         || StringUtils.isNullOrEmpty(osmObject.get(tag))) {
    98         if (!hasDerivedValue(tag)) {
    99         // object does not have this tag -> check for guess
    100         if (hasGuessedValue(tag)) {
    101             return "*" + getGuessedValue(tag);
    102         } else {
    103             // give up
     89        if (StringUtils.isNullOrEmpty(tag))
    10490            return MISSING_TAG;
    105         }
    106         } else { // ok, use derived value known via associated relation or
    107              // way
    108         return getDerivedValue(tag);
    109         }
    110     } else { // get existing tag value
    111         return osmObject.get(tag);
    112     }
     91        if (osmObject == null)
     92            return MISSING_TAG;
     93
     94        if (!osmObject.hasKey(tag)
     95            || StringUtils.isNullOrEmpty(osmObject.get(tag))) {
     96            if (!hasDerivedValue(tag)) {
     97            // object does not have this tag -> check for guess
     98            if (hasGuessedValue(tag)) {
     99                return "*" + getGuessedValue(tag);
     100            } else {
     101                // give up
     102                return MISSING_TAG;
     103            }
     104            } else { // ok, use derived value known via associated relation or
     105                 // way
     106            return getDerivedValue(tag);
     107            }
     108        } else { // get existing tag value
     109            return osmObject.get(tag);
     110        }
    113111    }
    114112
     
    116114     * Returns <tt>true</tt>, if this address node has a street name.
    117115     *
    118      * @return
     116     * @return <tt>true</tt>, if this address node has a street name
    119117     */
    120118    public boolean hasStreetName() {
    121     return hasTag(TagUtils.ADDR_STREET_TAG) || isPartOfRelation();
     119        return hasTag(TagConstants.ADDR_STREET_TAG) || isPartOfRelation();
    122120    }
    123121
     
    128126     */
    129127    public String getGuessedStreetName() {
    130     return getGuessedValue(TagUtils.ADDR_STREET_TAG);
     128        return getGuessedValue(TagConstants.ADDR_STREET_TAG);
    131129    }
    132130
     
    139137     *            the source object of the guess.
    140138     */
    141     public void setGuessedStreetName(String guessedStreetName,
    142         OsmPrimitive srcObj) {
    143     setGuessedValue(TagUtils.ADDR_STREET_TAG, guessedStreetName, srcObj);
     139    public void setGuessedStreetName(String guessedStreetName, OsmPrimitive srcObj) {
     140        setGuessedValue(TagConstants.ADDR_STREET_TAG, guessedStreetName, srcObj);
    144141    }
    145142
     
    150147     */
    151148    public boolean hasGuessedStreetName() {
    152     return hasGuessedValue(TagUtils.ADDR_STREET_TAG);
     149        return hasGuessedValue(TagConstants.ADDR_STREET_TAG);
    153150    }
    154151
     
    157154     */
    158155    public String getGuessedPostalCode() {
    159     return getGuessedValue(TagUtils.ADDR_POSTCODE_TAG);
     156        return getGuessedValue(TagConstants.ADDR_POSTCODE_TAG);
    160157    }
    161158
     
    169166     */
    170167    public void setGuessedPostalCode(String guessedPostCode, OsmPrimitive srcObj) {
    171     setGuessedValue(TagUtils.ADDR_POSTCODE_TAG, guessedPostCode, srcObj);
     168        setGuessedValue(TagConstants.ADDR_POSTCODE_TAG, guessedPostCode, srcObj);
    172169    }
    173170
     
    178175     */
    179176    public boolean hasGuessedPostalCode() {
    180     return hasGuessedValue(TagUtils.ADDR_POSTCODE_TAG);
     177        return hasGuessedValue(TagConstants.ADDR_POSTCODE_TAG);
    181178    }
    182179
     
    185182     */
    186183    public String getGuessedCity() {
    187     return getGuessedValue(TagUtils.ADDR_CITY_TAG);
     184        return getGuessedValue(TagConstants.ADDR_CITY_TAG);
    188185    }
    189186
     
    197194     */
    198195    public void setGuessedCity(String guessedCity, OsmPrimitive srcObj) {
    199     setGuessedValue(TagUtils.ADDR_CITY_TAG, guessedCity, srcObj);
     196        setGuessedValue(TagConstants.ADDR_CITY_TAG, guessedCity, srcObj);
    200197    }
    201198
     
    206203     */
    207204    public boolean hasGuessedCity() {
    208     return hasGuessedValue(TagUtils.ADDR_CITY_TAG);
     205        return hasGuessedValue(TagConstants.ADDR_CITY_TAG);
    209206    }
    210207
     
    212209     * Returns true, if this instance has guesses regarding address tags.
    213210     *
    214      * @return
     211     * @return true, if this instance has guesses regarding address tags
    215212     */
    216213    public boolean hasGuesses() {
    217     return guessedValues.size() > 0;
     214        return guessedValues.size() > 0;
    218215    }
    219216
     
    222219     */
    223220    public void applyAllGuesses() {
    224     for (String tag : guessedValues.keySet()) {
    225         applyGuessForTag(tag);
    226     }
    227 
    228     // Clear all guesses
    229     guessedValues.clear();
    230     guessedObjects.clear();
     221        for (String tag : guessedValues.keySet()) {
     222            applyGuessForTag(tag);
     223        }
     224
     225        // Clear all guesses
     226        guessedValues.clear();
     227        guessedObjects.clear();
    231228    }
    232229
     
    238235     */
    239236    public void applyGuessForTag(String tag) {
    240     if (guessedValues.containsKey(tag)) {
    241         String val = guessedValues.get(tag);
    242         if (!StringUtils.isNullOrEmpty(val)) {
    243         setOSMTag(tag, val);
    244         }
    245     }
     237        if (guessedValues.containsKey(tag)) {
     238            String val = guessedValues.get(tag);
     239            if (!StringUtils.isNullOrEmpty(val)) {
     240            setOSMTag(tag, val);
     241            }
     242        }
    246243    }
    247244
     
    249246     * Gets the name of the post code associated with this address.
    250247     *
    251      * @return
     248     * @return the name of the post code associated with this address
    252249     */
    253250    public String getPostalCode() {
    254     String pc = getTagValueWithGuess(TagUtils.ADDR_POSTCODE_TAG);
    255 
    256     if (!MISSING_TAG.equals(pc)
    257         && !PostalCodeChecker.hasValidPostalCode(getCountry(), pc)) {
    258         pc = "(!)" + pc;
    259     }
    260     return pc;
     251        String pc = getTagValueWithGuess(TagConstants.ADDR_POSTCODE_TAG);
     252
     253        if (!MISSING_TAG.equals(pc)
     254            && !PostalCodeChecker.hasValidPostalCode(getCountry(), pc)) {
     255            pc = "(!)" + pc;
     256        }
     257        return pc;
    261258    }
    262259
     
    267264     */
    268265    public boolean hasValidPostalCode() {
    269     return PostalCodeChecker.hasValidPostalCode(this);
     266        return PostalCodeChecker.hasValidPostalCode(this);
    270267    }
    271268
     
    276273     */
    277274    public boolean hasPostalCode() {
    278     return hasTag(TagUtils.ADDR_POSTCODE_TAG);
     275        return hasTag(TagConstants.ADDR_POSTCODE_TAG);
    279276    }
    280277
     
    282279     * Gets the name of the house number associated with this address.
    283280     *
    284      * @return
     281     * @return the name of the house number associated with this address
    285282     */
    286283    public String getHouseNumber() {
    287     if (!TagUtils.hasAddrHousenumberTag(osmObject)) {
    288         if (!isPartOfInterpolation) {
    289         return MISSING_TAG;
    290         } else {
    291         return INTERPOLATION_TAG;
    292         }
    293     }
    294     return TagUtils.getAddrHousenumberValue(osmObject);
     284        if (!TagUtils.hasAddrHousenumberTag(osmObject)) {
     285            if (!isPartOfInterpolation) {
     286            return MISSING_TAG;
     287            } else {
     288            return INTERPOLATION_TAG;
     289            }
     290        }
     291        return TagUtils.getAddrHousenumberValue(osmObject);
    295292    }
    296293
     
    301298     */
    302299    public boolean hasHouseNumber() {
    303     return TagUtils.hasAddrHousenumberTag(osmObject)
    304         || isPartOfInterpolation;
     300        return TagUtils.hasAddrHousenumberTag(osmObject) || isPartOfInterpolation;
    305301    }
    306302
    307303    @Override
    308         public String getName() {
    309     String name = TagUtils.getNameValue(osmObject);
    310     if (!StringUtils.isNullOrEmpty(name)) {
    311         return TagUtils.getAddrHousenameValue(osmObject);
    312     }
    313 
    314     return "";
     304    public String getName() {
     305        String name = TagUtils.getNameValue(osmObject);
     306        if (!StringUtils.isNullOrEmpty(name)) {
     307            return TagUtils.getAddrHousenameValue(osmObject);
     308        }
     309
     310        return "";
    315311    }
    316312
     
    321317     */
    322318    protected boolean isPartOfInterpolation() {
    323     return isPartOfInterpolation;
     319        return isPartOfInterpolation;
    324320    }
    325321
     
    330326     */
    331327    protected boolean isPartOfRelation() {
    332     return isPartOfAssocStreetRel;
     328        return isPartOfAssocStreetRel;
    333329    }
    334330
     
    336332     * Gets the name of the city associated with this address.
    337333     *
    338      * @return
     334     * @return the name of the city associated with this address
    339335     */
    340336    public String getCity() {
    341     return getTagValueWithGuess(TagUtils.ADDR_CITY_TAG);
     337        return getTagValueWithGuess(TagConstants.ADDR_CITY_TAG);
    342338    }
    343339
     
    348344     */
    349345    public boolean hasCity() {
    350     return hasTag(TagUtils.ADDR_CITY_TAG);
     346        return hasTag(TagConstants.ADDR_CITY_TAG);
    351347    }
    352348
     
    354350     * Gets the name of the state associated with this address.
    355351     *
    356      * @return
     352     * @return the name of the state associated with this address
    357353     */
    358354    public String getState() {
    359     return getTagValueWithGuess(TagUtils.ADDR_STATE_TAG);
     355        return getTagValueWithGuess(TagConstants.ADDR_STATE_TAG);
    360356    }
    361357
     
    366362     */
    367363    public boolean hasState() {
    368     return hasTag(TagUtils.ADDR_STATE_TAG);
     364        return hasTag(TagConstants.ADDR_STATE_TAG);
    369365    }
    370366
     
    372368     * Gets the name of the country associated with this address.
    373369     *
    374      * @return
     370     * @return the name of the country associated with this address
    375371     */
    376372    public String getCountry() {
    377     return getTagValueWithGuess(TagUtils.ADDR_COUNTRY_TAG);
     373        return getTagValueWithGuess(TagConstants.ADDR_COUNTRY_TAG);
    378374    }
    379375
     
    384380     */
    385381    public boolean hasCountry() {
    386     return hasTag(TagUtils.ADDR_COUNTRY_TAG);
     382        return hasTag(TagConstants.ADDR_COUNTRY_TAG);
    387383    }
    388384
     
    391387     */
    392388    public void removeAllAddressTags() {
    393     removeOSMTag(TagUtils.ADDR_CITY_TAG);
    394     removeOSMTag(TagUtils.ADDR_COUNTRY_TAG);
    395     removeOSMTag(TagUtils.ADDR_POSTCODE_TAG);
    396     removeOSMTag(TagUtils.ADDR_HOUSENUMBER_TAG);
    397     removeOSMTag(TagUtils.ADDR_STATE_TAG);
    398     removeOSMTag(TagUtils.ADDR_STREET_TAG);
     389        removeOSMTag(TagConstants.ADDR_CITY_TAG);
     390        removeOSMTag(TagConstants.ADDR_COUNTRY_TAG);
     391        removeOSMTag(TagConstants.ADDR_POSTCODE_TAG);
     392        removeOSMTag(TagConstants.ADDR_HOUSENUMBER_TAG);
     393        removeOSMTag(TagConstants.ADDR_STATE_TAG);
     394        removeOSMTag(TagConstants.ADDR_STREET_TAG);
    399395    }
    400396
     
    469465     * Applies the street name from the specified street node.
    470466     *
    471      * @param node
     467     * @param node street node
    472468     */
    473469    public void assignStreet(OSMStreet node) {
    474     if (node == null || !node.hasName())
    475         return;
    476 
    477     if (!node.getName().equals(getStreetName())) {
    478         setStreetName(node.getName());
    479         node.addAddress(this);
    480         fireEntityChanged(this);
    481     }
     470        if (node == null || !node.hasName())
     471            return;
     472
     473        if (!node.getName().equals(getStreetName())) {
     474            setStreetName(node.getName());
     475            node.addAddress(this);
     476            fireEntityChanged(this);
     477        }
    482478    }
    483479
     
    490486     */
    491487    public String getGuessedValue(String tag) {
    492     CheckParameterUtil.ensureParameterNotNull(tag, "tag");
    493 
    494     if (!hasGuessedValue(tag)) {
    495         return null;
    496     }
    497     return guessedValues.get(tag);
     488        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
     489
     490        if (!hasGuessedValue(tag)) {
     491            return null;
     492        }
     493        return guessedValues.get(tag);
    498494    }
    499495
     
    506502     */
    507503    public OsmPrimitive getGuessedObject(String tag) {
    508     CheckParameterUtil.ensureParameterNotNull(tag, "tag");
    509 
    510     if (guessedObjects.containsKey(tag)) {
    511         return guessedObjects.get(tag);
    512     }
    513     return null;
     504        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
     505
     506        if (guessedObjects.containsKey(tag)) {
     507            return guessedObjects.get(tag);
     508        }
     509        return null;
    514510    }
    515511
     
    521517     */
    522518    public Collection<OsmPrimitive> getGuessedObjects() {
    523     if (guessedObjects == null)
    524         return null;
    525 
    526     return guessedObjects.values();
     519        if (guessedObjects == null)
     520            return null;
     521
     522        return guessedObjects.values();
    527523    }
    528524
     
    534530     */
    535531    public boolean needsGuess() {
    536     return needsGuessedValue(TagUtils.ADDR_CITY_TAG)
    537         || needsGuessedValue(TagUtils.ADDR_POSTCODE_TAG)
    538         || needsGuessedValue(TagUtils.ADDR_COUNTRY_TAG) ||
    539         // needsGuessedValue(TagUtils.ADDR_STATE_TAG) ||
    540         needsGuessedValue(TagUtils.ADDR_STREET_TAG);
     532    return needsGuessedValue(TagConstants.ADDR_CITY_TAG)
     533        || needsGuessedValue(TagConstants.ADDR_POSTCODE_TAG)
     534        || needsGuessedValue(TagConstants.ADDR_COUNTRY_TAG) ||
     535        // needsGuessedValue(TagConstants.ADDR_STATE_TAG) ||
     536        needsGuessedValue(TagConstants.ADDR_STREET_TAG);
    541537    }
    542538
     
    547543     */
    548544    public boolean needsGuessedValue(String tag) {
    549     return MISSING_TAG.equals(getTagValueWithGuess(tag));
     545        return MISSING_TAG.equals(getTagValueWithGuess(tag));
    550546    }
    551547
     
    554550     */
    555551    public void clearAllGuesses() {
    556     guessedValues.clear();
     552        guessedValues.clear();
    557553    }
    558554
     
    603599     */
    604600    private boolean hasDerivedValue(String tag) {
    605     CheckParameterUtil.ensureParameterNotNull(tag, "tag");
    606 
    607     return derivedValues.containsKey(tag)
    608         && !StringUtils.isNullOrEmpty(derivedValues.get(tag));
     601        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
     602
     603        return derivedValues.containsKey(tag)
     604            && !StringUtils.isNullOrEmpty(derivedValues.get(tag));
    609605    }
    610606
     
    612608     * Returns true, if this instance has derived values from any referrer.
    613609     *
    614      * @return
     610     * @return true, if this instance has derived values from any referrer
    615611     */
    616612    public boolean hasDerivedValues() {
    617     return derivedValues.size() > 0;
     613        return derivedValues.size() > 0;
    618614    }
    619615
     
    623619     * @param tag
    624620     *            The tag to get the derived value for.
    625      * @return
     621     * @return the derived value for the given tag
    626622     */
    627623    public String getDerivedValue(String tag) {
    628     if (!hasDerivedValue(tag)) {
    629         return null;
    630     }
    631     return derivedValues.get(tag);
     624        if (!hasDerivedValue(tag)) {
     625            return null;
     626        }
     627        return derivedValues.get(tag);
    632628    }
    633629
     
    641637     */
    642638    public void setDerivedValue(String tag, String value) {
    643     derivedValues.put(tag, value);
     639        derivedValues.put(tag, value);
    644640    }
    645641
     
    647643     * Sets the street name of the address node.
    648644     *
    649      * @param streetName
     645     * @param streetName street name of the address node
    650646     */
    651647    public void setStreetName(String streetName) {
    652     if (streetName != null && streetName.length() == 0)
    653         return;
    654 
    655     setOSMTag(TagUtils.ADDR_STREET_TAG, streetName);
     648        if (streetName != null && streetName.length() == 0)
     649            return;
     650
     651        setOSMTag(TagConstants.ADDR_STREET_TAG, streetName);
    656652    }
    657653
     
    659655     * Sets the state of the address node.
    660656     *
    661      * @param state
     657     * @param state state of the address node
    662658     */
    663659    public void setState(String state) {
    664     if (state != null && state.length() == 0)
    665         return;
    666 
    667     setOSMTag(TagUtils.ADDR_STATE_TAG, state);
     660        if (state != null && state.length() == 0)
     661            return;
     662
     663        setOSMTag(TagConstants.ADDR_STATE_TAG, state);
    668664    }
    669665
     
    671667     * Sets the country of the address node.
    672668     *
    673      * @param country
     669     * @param country country of the address node
    674670     */
    675671    public void setCountry(String country) {
    676     if (country != null && country.length() == 0)
    677         return;
    678 
    679     setOSMTag(TagUtils.ADDR_COUNTRY_TAG, country);
     672        if (country != null && country.length() == 0)
     673            return;
     674
     675        setOSMTag(TagConstants.ADDR_COUNTRY_TAG, country);
    680676    }
    681677
     
    683679     * Sets the post code of the address node.
    684680     *
    685      * @param postCode
     681     * @param postCode post code of the address node
    686682     */
    687683    public void setPostCode(String postCode) {
    688     if (postCode != null && postCode.length() == 0)
    689         return;
    690 
    691     setOSMTag(TagUtils.ADDR_POSTCODE_TAG, postCode);
     684        if (postCode != null && postCode.length() == 0)
     685            return;
     686
     687        setOSMTag(TagConstants.ADDR_POSTCODE_TAG, postCode);
    692688    }
    693689
    694690    @Override
    695691    public void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor) {
    696     CheckParameterUtil.ensureParameterNotNull(visitor, "visitor");
    697 
    698     // Check for street
    699     if (!hasStreetName()) {
    700         AddressProblem p = new AddressProblem(this,
    701             tr("Address has no street"));
    702         if (hasGuessedStreetName()) { // guess exists -> add solution entry
    703         String tag = TagUtils.ADDR_STREET_TAG;
    704         addGuessValueSolution(p, tag);
    705         }
    706         addRemoveAddressTagsSolution(p);
    707         visitor.addProblem(p);
    708         // Street name exists, but is invalid -> ask the all knowing trash
    709         // heap
    710     } else if (!trashHeap.isValidStreetName(getStreetName())) {
    711         AddressProblem p = new AddressProblem(this,
    712             tr("Address has no valid street"));
    713         String match = trashHeap.getClosestStreetName(getStreetName());
    714 
    715         if (!StringUtils.isNullOrEmpty(match)) {
    716         setGuessedStreetName(match, null);
    717         addGuessValueSolution(p, TagUtils.ADDR_STREET_TAG);
    718         }
    719         visitor.addProblem(p);
    720     }
    721 
    722     // Check for postal code
    723     if (!hasPostalCode()) {
    724         AddressProblem p = new AddressProblem(this,
    725             tr("Address has no post code"));
    726         if (hasGuessedStreetName()) {
    727         String tag = TagUtils.ADDR_POSTCODE_TAG;
    728         addGuessValueSolution(p, tag);
    729         }
    730         addRemoveAddressTagsSolution(p);
    731         visitor.addProblem(p);
    732     }
    733 
    734     // Check for city
    735     if (!hasCity()) {
    736         AddressProblem p = new AddressProblem(this,
    737             tr("Address has no city"));
    738         if (hasGuessedStreetName()) {
    739         String tag = TagUtils.ADDR_CITY_TAG;
    740         addGuessValueSolution(p, tag);
    741         }
    742         addRemoveAddressTagsSolution(p);
    743         visitor.addProblem(p);
    744     }
    745 
    746     // Check for country
    747     if (!hasCountry()) {
    748         // TODO: Add guess for country
    749         AddressProblem p = new AddressProblem(this,
    750             tr("Address has no country"));
    751         addRemoveAddressTagsSolution(p);
    752         visitor.addProblem(p);
    753     }
     692        CheckParameterUtil.ensureParameterNotNull(visitor, "visitor");
     693
     694        // Check for street
     695        if (!hasStreetName()) {
     696            AddressProblem p = new AddressProblem(this,
     697                tr("Address has no street"));
     698            if (hasGuessedStreetName()) { // guess exists -> add solution entry
     699            String tag = TagConstants.ADDR_STREET_TAG;
     700            addGuessValueSolution(p, tag);
     701            }
     702            addRemoveAddressTagsSolution(p);
     703            visitor.addProblem(p);
     704            // Street name exists, but is invalid -> ask the all knowing trash
     705            // heap
     706        } else if (!trashHeap.isValidStreetName(getStreetName())) {
     707            AddressProblem p = new AddressProblem(this,
     708                tr("Address has no valid street"));
     709            String match = trashHeap.getClosestStreetName(getStreetName());
     710
     711            if (!StringUtils.isNullOrEmpty(match)) {
     712                setGuessedStreetName(match, null);
     713                addGuessValueSolution(p, TagConstants.ADDR_STREET_TAG);
     714            }
     715            visitor.addProblem(p);
     716        }
     717
     718        // Check for postal code
     719        if (!hasPostalCode()) {
     720            AddressProblem p = new AddressProblem(this, tr("Address has no post code"));
     721            if (hasGuessedStreetName()) {
     722                String tag = TagConstants.ADDR_POSTCODE_TAG;
     723                addGuessValueSolution(p, tag);
     724            }
     725            addRemoveAddressTagsSolution(p);
     726            visitor.addProblem(p);
     727        }
     728
     729        // Check for city
     730        if (!hasCity()) {
     731            AddressProblem p = new AddressProblem(this, tr("Address has no city"));
     732            if (hasGuessedStreetName()) {
     733                String tag = TagConstants.ADDR_CITY_TAG;
     734                addGuessValueSolution(p, tag);
     735            }
     736            addRemoveAddressTagsSolution(p);
     737            visitor.addProblem(p);
     738        }
     739
     740        // Check for country
     741        if (!hasCountry()) {
     742            // TODO: Add guess for country
     743            AddressProblem p = new AddressProblem(this, tr("Address has no country"));
     744            addRemoveAddressTagsSolution(p);
     745            visitor.addProblem(p);
     746        }
    754747    }
    755748
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMEntityBase.java

    r30737 r32970  
    3333    protected OsmPrimitive osmObject;
    3434
    35     /**
    36      * @param osmObject
    37      */
    3835    public OSMEntityBase(OsmPrimitive osmObject) {
    3936        super();
     
    5148    /**
    5249     * Adds a change listener.
    53      * @param listener
     50     * @param listener change listener
    5451     */
    5552    public static void addChangedListener(IAddressEditContainerListener listener) {
     
    6057    /**
    6158     * Removes a change listener.
    62      * @param listener
     59     * @param listener change listener
    6360     */
    6461    public static void removeChangedListener(IAddressEditContainerListener listener) {
     
    7976    /**
    8077     * Adds a command listener.
    81      * @param listener
    82      */
    83     @Override
    84         public void addCommandListener(ICommandListener listener) {
     78     * @param listener command listener
     79     */
     80    @Override
     81    public void addCommandListener(ICommandListener listener) {
    8582        CheckParameterUtil.ensureParameterNotNull(listener, "listener");
    8683        cmdListeners.add(listener);
     
    8986    /**
    9087     * Removes a command listener.
    91      * @param listener
    92      */
    93     @Override
    94         public void removeCommandListener(ICommandListener listener) {
     88     * @param listener command listener
     89     */
     90    @Override
     91    public void removeCommandListener(ICommandListener listener) {
    9592        CheckParameterUtil.ensureParameterNotNull(listener, "listener");
    9693        cmdListeners.remove(listener);
     
    115112
    116113    @Override
    117         public OsmPrimitive getOsmObject() {
     114    public OsmPrimitive getOsmObject() {
    118115        return osmObject;
    119116    }
     
    131128    public String getName() {
    132129        if (TagUtils.hasNameTag(osmObject)) {
    133             return  TagUtils.getNameValue(osmObject);
     130            return TagUtils.getNameValue(osmObject);
    134131        }
    135132        return "";
     
    202199
    203200        if (osm instanceof Node) {
    204             return ((Node)osm).getCoor();
     201            return ((Node) osm).getCoor();
    205202        // way: return center
    206203        } else if (osm instanceof Way) {
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreet.java

    r30737 r32970  
    1313 * consists at least of one segment.
    1414 *
    15  * @author Oliver Wieland <oliver.wieland@online.de>
     15 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    1616 */
    1717public class OSMStreet extends OSMEntityBase {
     
    1919    private List<OSMAddress> addresses;
    2020
    21     /**
    22      * @param osmPrimitive
    23      */
    2421    public OSMStreet(OsmPrimitive osmPrimitive) {
    2522        super(osmPrimitive);
     
    2724
    2825    @Override
    29         public List<IOSMEntity> getChildren() {
     26    public List<IOSMEntity> getChildren() {
    3027        return children;
    3128    }
     
    3330    /**
    3431     * Adds a street segment to the street node.
    35      * @param segment
     32     * @param segment street segment
    3633     */
    3734    public void addStreetSegment(OSMStreetSegment segment) {
     
    8986    /**
    9087     * Gets the number of addresses associated with this street.
    91      * @return
     88     * @return number of addresses associated with this street
    9289     */
    9390    public int getNumberOfAddresses() {
     
    9996    /**
    10097     * Gets the number of street segments of this street.
    101      * @return
     98     * @return number of street segments of this street
    10299     */
    103100    public int getNumberOfSegments() {
     
    116113     * Gets the road type(s) of this street. If the street has different types,
    117114     * they are separated by comma.
    118      * @return
     115     * @return road type(s) of this street
    119116     */
    120117    public String getType() {
     
    124121            OsmPrimitive osmPrim = seg.getOsmObject();
    125122            if (TagUtils.hasHighwayTag(osmPrim)) {
    126                 String val = osmPrim.get(TagUtils.HIGHWAY_TAG);
     123                String val = osmPrim.get(TagConstants.HIGHWAY_TAG);
    127124                if (!types.contains(val)) {
    128125                    types.add(val);
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreetSegment.java

    r30348 r32970  
    1010 * sometimes a street is separated into many segments, e. g. due to different speed limits, bridges, etc..
    1111 *
    12  * @author Oliver Wieland <oliver.wieland@online.de>
     12 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    1313 *
    1414 */
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmFactory.java

    r30737 r32970  
    77import org.openstreetmap.josm.data.osm.Way;
    88
    9 public class OsmFactory {
     9public final class OsmFactory {
    1010    private static HashMap<String, OSMAddress> addressCache = new HashMap<>();
     11
     12    private OsmFactory() {
     13        // Hide default constructor for utilities classes
     14    }
    1115
    1216    /**
    1317     * Creates an address node from an OSM node, if possible.
    14      * @param node
    15      * @return
     18     * @param node OSM node
     19     * @return created address
    1620     */
    1721    public static OSMAddress createNode(Node node) {
     
    3438    /**
    3539     * Creates an node entity from an OSM way, if possible.
    36      * @param way
     40     * @param way OSM way
    3741     * @return The new node instance or null; if given way is inappropriate.
    3842     */
     
    4347
    4448        // Check for building with address
    45         if (way.isClosed() && TagUtils.hasBuildingTag(way)  && TagUtils.isAddress(way)) {
     49        if (way.isClosed() && TagUtils.hasBuildingTag(way) && TagUtils.isAddress(way)) {
    4650            String aid = "" + way.getId();
    4751
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java

    r30348 r32970  
    1717import org.openstreetmap.josm.tools.Pair;
    1818
    19 // TODO: Auto-generated Javadoc
    2019/**
    2120 * The Class OsmUtils provides some utilities not provided by the OSM data framework.
    2221 */
    23 public class OsmUtils {
     22public final class OsmUtils {
    2423
    2524    /**
     
    3938     */
    4039    public static double getMinimumDistanceToWay(LatLon coor, Way w) {
    41         if (coor == null || w == null) return Double.POSITIVE_INFINITY;
     40        if (coor == null || w == null)
     41            return Double.POSITIVE_INFINITY;
    4242
    4343        double minDist = Double.MAX_VALUE;
    44         List<Pair<Node,Node>> x = w.getNodePairs(true);
     44        List<Pair<Node, Node>> x = w.getNodePairs(true);
    4545
    4646        for (Pair<Node, Node> pair : x) {
     
    126126                            if (!StringUtils.isNullOrEmpty(streetName)) {
    127127                                // street name found -> set property
    128                                 address.setDerivedValue(TagUtils.ADDR_STREET_TAG, streetName);
     128                                address.setDerivedValue(TagConstants.ADDR_STREET_TAG, streetName);
    129129                                hasValuesFromRel = true;
    130130                                break;
     
    136136                // Check for other address properties
    137137                if (TagUtils.hasAddrCityTag(r)) { // city
    138                     address.setDerivedValue(TagUtils.ADDR_CITY_TAG, TagUtils.getAddrCityValue(r));
     138                    address.setDerivedValue(TagConstants.ADDR_CITY_TAG, TagUtils.getAddrCityValue(r));
    139139                    hasValuesFromRel = true;
    140140                }
    141141                if (TagUtils.hasAddrCountryTag(r)) { // country
    142                     address.setDerivedValue(TagUtils.ADDR_COUNTRY_TAG, TagUtils.getAddrCountryValue(r));
     142                    address.setDerivedValue(TagConstants.ADDR_COUNTRY_TAG, TagUtils.getAddrCountryValue(r));
    143143                    hasValuesFromRel = true;
    144144                }
    145145                if (TagUtils.hasAddrPostcodeTag(r)) { // postcode
    146                     address.setDerivedValue(TagUtils.ADDR_POSTCODE_TAG, TagUtils.getAddrPostcodeValue(r));
     146                    address.setDerivedValue(TagConstants.ADDR_POSTCODE_TAG, TagUtils.getAddrPostcodeValue(r));
    147147                    hasValuesFromRel = true;
    148148                }
     
    167167                Way w = (Way) osm;
    168168                if (TagUtils.hasAddrInterpolationTag(w)) {
    169                     applyDerivedValue(address, w, TagUtils.ADDR_POSTCODE_TAG);
    170                     applyDerivedValue(address, w, TagUtils.ADDR_CITY_TAG);
    171                     applyDerivedValue(address, w, TagUtils.ADDR_COUNTRY_TAG);
    172                     applyDerivedValue(address, w, TagUtils.ADDR_STREET_TAG);
    173                     applyDerivedValue(address, w, TagUtils.ADDR_STATE_TAG);
     169                    applyDerivedValue(address, w, TagConstants.ADDR_POSTCODE_TAG);
     170                    applyDerivedValue(address, w, TagConstants.ADDR_CITY_TAG);
     171                    applyDerivedValue(address, w, TagConstants.ADDR_COUNTRY_TAG);
     172                    applyDerivedValue(address, w, TagConstants.ADDR_STREET_TAG);
     173                    applyDerivedValue(address, w, TagConstants.ADDR_STATE_TAG);
    174174                    return true;
    175175                }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/PostalCodeChecker.java

    r30737 r32970  
    1010 * The Class PostcodeChecker.
    1111 */
    12 public class PostalCodeChecker {
     12public final class PostalCodeChecker {
    1313    private static HashMap<String, String> postalCodePatternMap = new HashMap<>();
    1414
    1515    static {
    1616        fillMap();
     17    }
     18
     19    private PostalCodeChecker() {
     20        // Hide default constructor for utilities classes
    1721    }
    1822
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StringUtils.java

    r30348 r32970  
    44import java.util.List;
    55
    6 public class StringUtils {
     6public final class StringUtils {
     7
     8    private StringUtils() {
     9        // Hide default constructor for utilities classes
     10    }
     11
    712    /**
    813     * Checks, if a string is either null or empty.
     
    5964                /*
    6065                 * if (i >= m || j >= n) { l[i][j] = 0; } else
    61                  */if (a.charAt(i) == b.charAt(j)) {
     66                 */
     67                if (a.charAt(i) == b.charAt(j)) {
    6268                    l[i][j] = 1 + l[i + 1][j + 1];
    6369                } else {
     
    7480     * @param a The first string.
    7581     * @param b The second string.
    76      * @return
     82     * @return the longest common substring of a and b
    7783     */
    7884    public static String getLongestCommonSubstring(String a, String b) {
     
    102108        }
    103109
    104         l = null;
    105110        return sb.toString();
    106111    }
     
    126131        for (String curString : haystack) {
    127132            int ll = lcsLength(needle, curString);
    128             double ratio = ll / (double)lNeedle;
     133            double ratio = ll / (double) lNeedle;
    129134            if (ratio > maxRatio) {
    130135                maxRatio = ratio;
    131136                bestMatch = curString;
    132137            }
    133 
    134138        }
    135139
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/TagUtils.java

    r30348 r32970  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.fixAddresses;
     3
     4import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ACCESS_TAG;
     5import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_CITY_TAG;
     6import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_COUNTRY_TAG;
     7import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_HOUSENAME_TAG;
     8import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_HOUSENUMBER_TAG;
     9import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_INCLUSION_TAG;
     10import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_INTERPOLATION_TAG;
     11import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_POSTCODE_TAG;
     12import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_STATE_TAG;
     13import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_STREET_TAG;
     14import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADMIN_LEVEL_TAG;
     15import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.AGRICULTURAL_TAG;
     16import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.AMENITY_TAG;
     17import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.AREA_TAG;
     18import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ASSOCIATEDSTREET_RELATION_TYPE;
     19import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BARRIER_TAG;
     20import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BICYCLE_TAG;
     21import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BOUNDARY_TAG;
     22import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BRIDGE_TAG;
     23import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BUILDING_LEVELS_TAG;
     24import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BUILDING_TAG;
     25import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CABLES_TAG;
     26import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CAPACITY_DISABLED_TAG;
     27import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CAPACITY_TAG;
     28import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.COMMENT_TAG;
     29import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CONSTRUCTION_TAG;
     30import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.COUNTRIES_REQUIRE_STATE;
     31import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CRAFT_TAG;
     32import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CUISINE_TAG;
     33import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CUTTING_TAG;
     34import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.DENOMINATION_TAG;
     35import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ELECTRIFIED_TAG;
     36import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.EMBANKMENT_TAG;
     37import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FIREPLACE_TAG;
     38import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FIXME_TAG;
     39import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FOOT_TAG;
     40import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FREQUENCY_TAG;
     41import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.GOODS_TAG;
     42import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.HGV_TAG;
     43import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.HIGHWAY_TAG;
     44import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.HORSE_TAG;
     45import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.INT_REF_TAG;
     46import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.JUNCTION_TAG;
     47import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LANDUSE_TAG;
     48import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LANES_TAG;
     49import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LAYER_TAG;
     50import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LEISURE_TAG;
     51import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LIT_TAG;
     52import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LOC_REF_TAG;
     53import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MAN_MADE_TAG;
     54import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MAXSPEED_TAG;
     55import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MOTORCAR_TAG;
     56import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MOTORCYCLE_TAG;
     57import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MOTOR_VEHICLE_TAG;
     58import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NAME_DE_TAG;
     59import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NAME_TAG;
     60import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NATURAL_TAG;
     61import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NAT_REF_TAG;
     62import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NOEXIT_TAG;
     63import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NOTE_DE_TAG;
     64import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NOTE_TAG;
     65import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ONEWAY_TAG;
     66import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.OPENING_HOURS_TAG;
     67import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.OPERATOR_TAG;
     68import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.PARKING_TAG;
     69import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.POWER_TAG;
     70import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.RAILWAY_TAG;
     71import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.REF_TAG;
     72import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.RELATION_TYPE;
     73import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.RELIGION_TAG;
     74import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ROUTE_TAG;
     75import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SAC_SCALE_TAG;
     76import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SEGREGATED_TAG;
     77import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SERVICE_TAG;
     78import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SHOP_TAG;
     79import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SMOOTHNESS_TAG;
     80import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SOURCE_TAG;
     81import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SPORT_TAG;
     82import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.STREET_RELATION_ROLE;
     83import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SURFACE_TAG;
     84import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TOURISM_TAG;
     85import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TRACKTYPE_TAG;
     86import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TRAIL_VISIBILITY_TAG;
     87import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TUNNEL_TAG;
     88import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TYPE_TAG;
     89import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.VEHICLE_TAG;
     90import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.VOLTAGE_TAG;
     91import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WATERWAY_TAG;
     92import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WHEELCHAIR_TAG;
     93import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WHITEWATER_SECTION_GRADE_TAG;
     94import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WHITEWATER_TAG;
     95import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WIDTH_TAG;
     96import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WIRES_TAG;
     97import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WOOD_TAG;
    398
    499import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    7102import org.openstreetmap.josm.data.osm.Way;
    8103
     104// CHECKSTYLE.OFF: MethodCountCheck
     105
    9106/**
    10107 * Contains the tags used within OSM. FIXME: Maybe there is a class or similar
    11108 * within JOSM which already defines them, but I have not found it so far.
    12109 *
    13  * @author Oliver Wieland <oliver.wieland@online.de>
    14  *
     110 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    15111 */
    16112public final class TagUtils {
    17     private static String COUNTRIES_REQUIRE_STATE[] = {
    18         "en_US",    /* USA */
    19         "en_AU" /* Australia */
    20     };
     113
     114    private TagUtils() {
     115        // Hide default constructor for utilities classes
     116    }
    21117
    22118    /**
    23119     * Checks if the given OSM object has a (non-empty) value for the given tag.
    24      *
    25120     * @param osm the osm object to inspect.
    26121     * @param tag the tag to look for.
     
    33128    /**
    34129     * Checks if the given OSM primitive is an address node.
    35      * @return
     130     * @return {@code true} if the given OSM primitive is an address node
    36131     */
    37132    public static boolean isAddress(OsmPrimitive osmObject) {
    38         return  TagUtils.hasAddrCityTag(osmObject) || TagUtils.hasAddrCountryTag(osmObject) ||
    39                 TagUtils.hasAddrHousenumberTag(osmObject) || TagUtils.hasAddrPostcodeTag(osmObject) ||
    40                 TagUtils.hasAddrStateTag(osmObject) || TagUtils.hasAddrStreetTag(osmObject);
     133        return TagUtils.hasAddrCityTag(osmObject) || TagUtils.hasAddrCountryTag(osmObject) ||
     134               TagUtils.hasAddrHousenumberTag(osmObject) || TagUtils.hasAddrPostcodeTag(osmObject) ||
     135               TagUtils.hasAddrStateTag(osmObject) || TagUtils.hasAddrStreetTag(osmObject);
    41136    }
    42137
    43138    /**
    44139     * Check if OSM primitive has a tag 'parking'.
    45      *
    46      * @param osmPrimitive
    47      *            The OSM entity to check.
     140     * @param osmPrimitive The OSM entity to check.
    48141     */
    49142    public static boolean hasParkingTag(OsmPrimitive osmPrimitive) {
     
    53146    /**
    54147     * Gets the value of tag 'parking'.
    55      *
    56      * @param osmPrimitive
    57      *            The OSM entity to check.
     148     * @param osmPrimitive The OSM entity to check.
    58149     */
    59150    public static String getParkingValue(OsmPrimitive osmPrimitive) {
     
    63154    /**
    64155     * Check if OSM primitive has a tag 'shop'.
    65      *
    66      * @param osmPrimitive
    67      *            The OSM entity to check.
     156     * @param osmPrimitive The OSM entity to check.
    68157     */
    69158    public static boolean hasShopTag(OsmPrimitive osmPrimitive) {
     
    73162    /**
    74163     * Gets the value of tag 'shop'.
    75      *
    76      * @param osmPrimitive
    77      *            The OSM entity to check.
     164     * @param osmPrimitive The OSM entity to check.
    78165     */
    79166    public static String getShopValue(OsmPrimitive osmPrimitive) {
     
    83170    /**
    84171     * Check if OSM primitive has a tag 'craft'.
    85      *
    86      * @param osmPrimitive
    87      *            The OSM entity to check.
     172     * @param osmPrimitive The OSM entity to check.
    88173     */
    89174    public static boolean hasCraftTag(OsmPrimitive osmPrimitive) {
     
    93178    /**
    94179     * Gets the value of tag 'craft'.
    95      *
    96      * @param osmPrimitive
    97      *            The OSM entity to check.
     180     * @param osmPrimitive The OSM entity to check.
    98181     */
    99182    public static String getCraftValue(OsmPrimitive osmPrimitive) {
     
    103186    /**
    104187     * Check if OSM primitive has a tag 'surface'.
    105      *
    106      * @param osmPrimitive
    107      *            The OSM entity to check.
     188     * @param osmPrimitive The OSM entity to check.
    108189     */
    109190    public static boolean hasSurfaceTag(OsmPrimitive osmPrimitive) {
     
    113194    /**
    114195     * Gets the value of tag 'surface'.
    115      *
    116      * @param osmPrimitive
    117      *            The OSM entity to check.
     196     * @param osmPrimitive The OSM entity to check.
    118197     */
    119198    public static String getSurfaceValue(OsmPrimitive osmPrimitive) {
     
    123202    /**
    124203     * Check if OSM primitive has a tag 'cuisine'.
    125      *
    126      * @param osmPrimitive
    127      *            The OSM entity to check.
     204     * @param osmPrimitive The OSM entity to check.
    128205     */
    129206    public static boolean hasCuisineTag(OsmPrimitive osmPrimitive) {
     
    133210    /**
    134211     * Gets the value of tag 'cuisine'.
    135      *
    136      * @param osmPrimitive
    137      *            The OSM entity to check.
     212     * @param osmPrimitive The OSM entity to check.
    138213     */
    139214    public static String getCuisineValue(OsmPrimitive osmPrimitive) {
     
    143218    /**
    144219     * Check if OSM primitive has a tag 'wood'.
    145      *
    146      * @param osmPrimitive
    147      *            The OSM entity to check.
     220     * @param osmPrimitive The OSM entity to check.
    148221     */
    149222    public static boolean hasWoodTag(OsmPrimitive osmPrimitive) {
     
    153226    /**
    154227     * Gets the value of tag 'wood'.
    155      *
    156      * @param osmPrimitive
    157      *            The OSM entity to check.
     228     * @param osmPrimitive The OSM entity to check.
    158229     */
    159230    public static String getWoodValue(OsmPrimitive osmPrimitive) {
     
    163234    /**
    164235     * Check if OSM primitive has a tag 'foot'.
    165      *
    166      * @param osmPrimitive
    167      *            The OSM entity to check.
     236     * @param osmPrimitive The OSM entity to check.
    168237     */
    169238    public static boolean hasFootTag(OsmPrimitive osmPrimitive) {
     
    173242    /**
    174243     * Gets the value of tag 'foot'.
    175      *
    176      * @param osmPrimitive
    177      *            The OSM entity to check.
     244     * @param osmPrimitive The OSM entity to check.
    178245     */
    179246    public static String getFootValue(OsmPrimitive osmPrimitive) {
     
    183250    /**
    184251     * Check if OSM primitive has a tag 'name:de'.
    185      *
    186      * @param osmPrimitive
    187      *            The OSM entity to check.
     252     * @param osmPrimitive The OSM entity to check.
    188253     */
    189254    public static boolean hasNameDeTag(OsmPrimitive osmPrimitive) {
     
    193258    /**
    194259     * Gets the value of tag 'name:de'.
    195      *
    196      * @param osmPrimitive
    197      *            The OSM entity to check.
     260     * @param osmPrimitive The OSM entity to check.
    198261     */
    199262    public static String getNameDeValue(OsmPrimitive osmPrimitive) {
     
    203266    /**
    204267     * Check if OSM primitive has a tag 'nat_ref'.
    205      *
    206      * @param osmPrimitive
    207      *            The OSM entity to check.
     268     * @param osmPrimitive The OSM entity to check.
    208269     */
    209270    public static boolean hasNatRefTag(OsmPrimitive osmPrimitive) {
     
    213274    /**
    214275     * Gets the value of tag 'nat_ref'.
    215      *
    216      * @param osmPrimitive
    217      *            The OSM entity to check.
     276     * @param osmPrimitive The OSM entity to check.
    218277     */
    219278    public static String getNatRefValue(OsmPrimitive osmPrimitive) {
     
    223282    /**
    224283     * Check if OSM primitive has a tag 'note:de'.
    225      *
    226      * @param osmPrimitive
    227      *            The OSM entity to check.
     284     * @param osmPrimitive The OSM entity to check.
    228285     */
    229286    public static boolean hasNoteDeTag(OsmPrimitive osmPrimitive) {
     
    233290    /**
    234291     * Gets the value of tag 'note:de'.
    235      *
    236      * @param osmPrimitive
    237      *            The OSM entity to check.
     292     * @param osmPrimitive The OSM entity to check.
    238293     */
    239294    public static String getNoteDeValue(OsmPrimitive osmPrimitive) {
     
    243298    /**
    244299     * Check if OSM primitive has a tag 'addr:street'.
    245      *
    246      * @param osmPrimitive
    247      *            The OSM entity to check.
     300     * @param osmPrimitive The OSM entity to check.
    248301     */
    249302    public static boolean hasAddrStreetTag(OsmPrimitive osmPrimitive) {
     
    254307    /**
    255308     * Gets the value of tag 'addr:street'.
    256      *
    257      * @param osmPrimitive
    258      *            The OSM entity to check.
     309     * @param osmPrimitive The OSM entity to check.
    259310     */
    260311    public static String getAddrStreetValue(OsmPrimitive osmPrimitive) {
     
    264315    /**
    265316     * Check if OSM primitive has a tag 'type'.
    266      *
    267      * @param osmPrimitive
    268      *            The OSM entity to check.
     317     * @param osmPrimitive The OSM entity to check.
    269318     */
    270319    public static boolean hasTypeTag(OsmPrimitive osmPrimitive) {
     
    274323    /**
    275324     * Gets the value of tag 'type'.
    276      *
    277      * @param osmPrimitive
    278      *            The OSM entity to check.
     325     * @param osmPrimitive The OSM entity to check.
    279326     */
    280327    public static String getTypeValue(OsmPrimitive osmPrimitive) {
     
    284331    /**
    285332     * Check if OSM primitive has a tag 'addr:city'.
    286      *
    287      * @param osmPrimitive
    288      *            The OSM entity to check.
     333     * @param osmPrimitive The OSM entity to check.
    289334     */
    290335    public static boolean hasAddrCityTag(OsmPrimitive osmPrimitive) {
     
    295340    /**
    296341     * Gets the value of tag 'addr:city'.
    297      *
    298      * @param osmPrimitive
    299      *            The OSM entity to check.
     342     * @param osmPrimitive The OSM entity to check.
    300343     */
    301344    public static String getAddrCityValue(OsmPrimitive osmPrimitive) {
     
    305348    /**
    306349     * Check if OSM primitive has a tag 'boundary'.
    307      *
    308      * @param osmPrimitive
    309      *            The OSM entity to check.
     350     * @param osmPrimitive The OSM entity to check.
    310351     */
    311352    public static boolean hasBoundaryTag(OsmPrimitive osmPrimitive) {
     
    315356    /**
    316357     * Gets the value of tag 'boundary'.
    317      *
    318      * @param osmPrimitive
    319      *            The OSM entity to check.
     358     * @param osmPrimitive The OSM entity to check.
    320359     */
    321360    public static String getBoundaryValue(OsmPrimitive osmPrimitive) {
     
    325364    /**
    326365     * Check if OSM primitive has a tag 'smoothness'.
    327      *
    328      * @param osmPrimitive
    329      *            The OSM entity to check.
     366     * @param osmPrimitive The OSM entity to check.
    330367     */
    331368    public static boolean hasSmoothnessTag(OsmPrimitive osmPrimitive) {
     
    336373    /**
    337374     * Gets the value of tag 'smoothness'.
    338      *
    339      * @param osmPrimitive
    340      *            The OSM entity to check.
     375     * @param osmPrimitive The OSM entity to check.
    341376     */
    342377    public static String getSmoothnessValue(OsmPrimitive osmPrimitive) {
     
    346381    /**
    347382     * Check if OSM primitive has a tag 'opening_hours'.
    348      *
    349      * @param osmPrimitive
    350      *            The OSM entity to check.
     383     * @param osmPrimitive The OSM entity to check.
    351384     */
    352385    public static boolean hasOpeningHoursTag(OsmPrimitive osmPrimitive) {
     
    357390    /**
    358391     * Gets the value of tag 'opening_hours'.
    359      *
    360      * @param osmPrimitive
    361      *            The OSM entity to check.
     392     * @param osmPrimitive The OSM entity to check.
    362393     */
    363394    public static String getOpeningHoursValue(OsmPrimitive osmPrimitive) {
     
    368399    /**
    369400     * Check if OSM primitive has a tag 'bicycle'.
    370      *
    371      * @param osmPrimitive
    372      *            The OSM entity to check.
     401     * @param osmPrimitive The OSM entity to check.
    373402     */
    374403    public static boolean hasBicycleTag(OsmPrimitive osmPrimitive) {
     
    378407    /**
    379408     * Gets the value of tag 'bicycle'.
    380      *
    381      * @param osmPrimitive
    382      *            The OSM entity to check.
     409     * @param osmPrimitive The OSM entity to check.
    383410     */
    384411    public static String getBicycleValue(OsmPrimitive osmPrimitive) {
     
    388415    /**
    389416     * Check if OSM primitive has a tag 'religion'.
    390      *
    391      * @param osmPrimitive
    392      *            The OSM entity to check.
     417     * @param osmPrimitive The OSM entity to check.
    393418     */
    394419    public static boolean hasReligionTag(OsmPrimitive osmPrimitive) {
     
    398423    /**
    399424     * Gets the value of tag 'religion'.
    400      *
    401      * @param osmPrimitive
    402      *            The OSM entity to check.
     425     * @param osmPrimitive The OSM entity to check.
    403426     */
    404427    public static String getReligionValue(OsmPrimitive osmPrimitive) {
     
    408431    /**
    409432     * Check if OSM primitive has a tag 'barrier'.
    410      *
    411      * @param osmPrimitive
    412      *            The OSM entity to check.
     433     * @param osmPrimitive The OSM entity to check.
    413434     */
    414435    public static boolean hasBarrierTag(OsmPrimitive osmPrimitive) {
     
    418439    /**
    419440     * Gets the value of tag 'barrier'.
    420      *
    421      * @param osmPrimitive
    422      *            The OSM entity to check.
     441     * @param osmPrimitive The OSM entity to check.
    423442     */
    424443    public static String getBarrierValue(OsmPrimitive osmPrimitive) {
     
    428447    /**
    429448     * Check if OSM primitive has a tag 'power'.
    430      *
    431      * @param osmPrimitive
    432      *            The OSM entity to check.
     449     * @param osmPrimitive The OSM entity to check.
    433450     */
    434451    public static boolean hasPowerTag(OsmPrimitive osmPrimitive) {
     
    438455    /**
    439456     * Gets the value of tag 'power'.
    440      *
    441      * @param osmPrimitive
    442      *            The OSM entity to check.
     457     * @param osmPrimitive The OSM entity to check.
    443458     */
    444459    public static String getPowerValue(OsmPrimitive osmPrimitive) {
     
    448463    /**
    449464     * Check if OSM primitive has a tag 'landuse'.
    450      *
    451      * @param osmPrimitive
    452      *            The OSM entity to check.
     465     * @param osmPrimitive The OSM entity to check.
    453466     */
    454467    public static boolean hasLanduseTag(OsmPrimitive osmPrimitive) {
     
    458471    /**
    459472     * Gets the value of tag 'landuse'.
    460      *
    461      * @param osmPrimitive
    462      *            The OSM entity to check.
     473     * @param osmPrimitive The OSM entity to check.
    463474     */
    464475    public static String getLanduseValue(OsmPrimitive osmPrimitive) {
     
    468479    /**
    469480     * Check if OSM primitive has a tag 'fireplace'.
    470      *
    471      * @param osmPrimitive
    472      *            The OSM entity to check.
     481     * @param osmPrimitive The OSM entity to check.
    473482     */
    474483    public static boolean hasFireplaceTag(OsmPrimitive osmPrimitive) {
     
    479488    /**
    480489     * Gets the value of tag 'fireplace'.
    481      *
    482      * @param osmPrimitive
    483      *            The OSM entity to check.
     490     * @param osmPrimitive The OSM entity to check.
    484491     */
    485492    public static String getFireplaceValue(OsmPrimitive osmPrimitive) {
     
    489496    /**
    490497     * Check if OSM primitive has a tag 'int_ref'.
    491      *
    492      * @param osmPrimitive
    493      *            The OSM entity to check.
     498     * @param osmPrimitive The OSM entity to check.
    494499     */
    495500    public static boolean hasIntRefTag(OsmPrimitive osmPrimitive) {
     
    499504    /**
    500505     * Gets the value of tag 'int_ref'.
    501      *
    502      * @param osmPrimitive
    503      *            The OSM entity to check.
     506     * @param osmPrimitive The OSM entity to check.
    504507     */
    505508    public static String getIntRefValue(OsmPrimitive osmPrimitive) {
     
    509512    /**
    510513     * Check if OSM primitive has a tag 'whitewater:section_grade'.
    511      *
    512      * @param osmPrimitive
    513      *            The OSM entity to check.
     514     * @param osmPrimitive The OSM entity to check.
    514515     */
    515516    public static boolean hasWhitewaterSectionGradeTag(OsmPrimitive osmPrimitive) {
    516         return osmPrimitive != null ? osmPrimitive
    517                 .hasKey(WHITEWATER_SECTION_GRADE_TAG) : false;
     517        return osmPrimitive != null ? osmPrimitive.hasKey(WHITEWATER_SECTION_GRADE_TAG) : false;
    518518    }
    519519
    520520    /**
    521521     * Gets the value of tag 'whitewater:section_grade'.
    522      *
    523      * @param osmPrimitive
    524      *            The OSM entity to check.
     522     * @param osmPrimitive The OSM entity to check.
    525523     */
    526524    public static String getWhitewaterSectionGradeValue(
     
    532530    /**
    533531     * Check if OSM primitive has a tag 'denomination'.
    534      *
    535      * @param osmPrimitive
    536      *            The OSM entity to check.
     532     * @param osmPrimitive The OSM entity to check.
    537533     */
    538534    public static boolean hasDenominationTag(OsmPrimitive osmPrimitive) {
    539         return osmPrimitive != null ? osmPrimitive.hasKey(DENOMINATION_TAG)
    540                 : false;
     535        return osmPrimitive != null ? osmPrimitive.hasKey(DENOMINATION_TAG) : false;
    541536    }
    542537
    543538    /**
    544539     * Gets the value of tag 'denomination'.
    545      *
    546      * @param osmPrimitive
    547      *            The OSM entity to check.
     540     * @param osmPrimitive The OSM entity to check.
    548541     */
    549542    public static String getDenominationValue(OsmPrimitive osmPrimitive) {
     
    553546    /**
    554547     * Check if OSM primitive has a tag 'addr:postcode'.
    555      *
    556      * @param osmPrimitive
    557      *            The OSM entity to check.
     548     * @param osmPrimitive The OSM entity to check.
    558549     */
    559550    public static boolean hasAddrPostcodeTag(OsmPrimitive osmPrimitive) {
    560         return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_POSTCODE_TAG)
    561                 : false;
     551        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_POSTCODE_TAG) : false;
    562552    }
    563553
    564554    /**
    565555     * Gets the value of tag 'addr:postcode'.
    566      *
    567      * @param osmPrimitive
    568      *            The OSM entity to check.
     556     * @param osmPrimitive The OSM entity to check.
    569557     */
    570558    public static String getAddrPostcodeValue(OsmPrimitive osmPrimitive) {
    571         return osmPrimitive != null ? osmPrimitive.get(ADDR_POSTCODE_TAG)
    572                 : null;
     559        return osmPrimitive != null ? osmPrimitive.get(ADDR_POSTCODE_TAG) : null;
    573560    }
    574561
    575562    /**
    576563     * Check if OSM primitive has a tag 'wires'.
    577      *
    578      * @param osmPrimitive
    579      *            The OSM entity to check.
     564     * @param osmPrimitive The OSM entity to check.
    580565     */
    581566    public static boolean hasWiresTag(OsmPrimitive osmPrimitive) {
     
    585570    /**
    586571     * Gets the value of tag 'wires'.
    587      *
    588      * @param osmPrimitive
    589      *            The OSM entity to check.
     572     * @param osmPrimitive The OSM entity to check.
    590573     */
    591574    public static String getWiresValue(OsmPrimitive osmPrimitive) {
     
    595578    /**
    596579     * Check if OSM primitive has a tag 'loc_ref'.
    597      *
    598      * @param osmPrimitive
    599      *            The OSM entity to check.
     580     * @param osmPrimitive The OSM entity to check.
    600581     */
    601582    public static boolean hasLocRefTag(OsmPrimitive osmPrimitive) {
     
    605586    /**
    606587     * Gets the value of tag 'loc_ref'.
    607      *
    608      * @param osmPrimitive
    609      *            The OSM entity to check.
     588     * @param osmPrimitive The OSM entity to check.
    610589     */
    611590    public static String getLocRefValue(OsmPrimitive osmPrimitive) {
     
    615594    /**
    616595     * Check if OSM primitive has a tag 'width'.
    617      *
    618      * @param osmPrimitive
    619      *            The OSM entity to check.
     596     * @param osmPrimitive The OSM entity to check.
    620597     */
    621598    public static boolean hasWidthTag(OsmPrimitive osmPrimitive) {
     
    625602    /**
    626603     * Gets the value of tag 'width'.
    627      *
    628      * @param osmPrimitive
    629      *            The OSM entity to check.
     604     * @param osmPrimitive The OSM entity to check.
    630605     */
    631606    public static String getWidthValue(OsmPrimitive osmPrimitive) {
     
    635610    /**
    636611     * Check if OSM primitive has a tag 'tourism'.
    637      *
    638      * @param osmPrimitive
    639      *            The OSM entity to check.
     612     * @param osmPrimitive The OSM entity to check.
    640613     */
    641614    public static boolean hasTourismTag(OsmPrimitive osmPrimitive) {
     
    645618    /**
    646619     * Gets the value of tag 'tourism'.
    647      *
    648      * @param osmPrimitive
    649      *            The OSM entity to check.
     620     * @param osmPrimitive The OSM entity to check.
    650621     */
    651622    public static String getTourismValue(OsmPrimitive osmPrimitive) {
     
    655626    /**
    656627     * Check if OSM primitive has a tag 'leisure'.
    657      *
    658      * @param osmPrimitive
    659      *            The OSM entity to check.
     628     * @param osmPrimitive The OSM entity to check.
    660629     */
    661630    public static boolean hasLeisureTag(OsmPrimitive osmPrimitive) {
     
    665634    /**
    666635     * Gets the value of tag 'leisure'.
    667      *
    668      * @param osmPrimitive
    669      *            The OSM entity to check.
     636     * @param osmPrimitive The OSM entity to check.
    670637     */
    671638    public static String getLeisureValue(OsmPrimitive osmPrimitive) {
     
    675642    /**
    676643     * Check if OSM primitive has a tag 'electrified'.
    677      *
    678      * @param osmPrimitive
    679      *            The OSM entity to check.
     644     * @param osmPrimitive The OSM entity to check.
    680645     */
    681646    public static boolean hasElectrifiedTag(OsmPrimitive osmPrimitive) {
    682         return osmPrimitive != null ? osmPrimitive.hasKey(ELECTRIFIED_TAG)
    683                 : false;
     647        return osmPrimitive != null ? osmPrimitive.hasKey(ELECTRIFIED_TAG) : false;
    684648    }
    685649
     
    687651     * Gets the value of tag 'electrified'.
    688652     *
    689      * @param osmPrimitive
    690      *            The OSM entity to check.
     653     * @param osmPrimitive The OSM entity to check.
    691654     */
    692655    public static String getElectrifiedValue(OsmPrimitive osmPrimitive) {
     
    696659    /**
    697660     * Check if OSM primitive has a tag 'junction'.
    698      *
    699      * @param osmPrimitive
    700      *            The OSM entity to check.
     661     * @param osmPrimitive The OSM entity to check.
    701662     */
    702663    public static boolean hasJunctionTag(OsmPrimitive osmPrimitive) {
     
    706667    /**
    707668     * Gets the value of tag 'junction'.
    708      *
    709      * @param osmPrimitive
    710      *            The OSM entity to check.
     669     * @param osmPrimitive The OSM entity to check.
    711670     */
    712671    public static String getJunctionValue(OsmPrimitive osmPrimitive) {
     
    716675    /**
    717676     * Check if OSM primitive has a tag 'railway'.
    718      *
    719      * @param osmPrimitive
    720      *            The OSM entity to check.
     677     * @param osmPrimitive The OSM entity to check.
    721678     */
    722679    public static boolean hasRailwayTag(OsmPrimitive osmPrimitive) {
     
    726683    /**
    727684     * Gets the value of tag 'railway'.
    728      *
    729      * @param osmPrimitive
    730      *            The OSM entity to check.
     685     * @param osmPrimitive The OSM entity to check.
    731686     */
    732687    public static String getRailwayValue(OsmPrimitive osmPrimitive) {
     
    736691    /**
    737692     * Check if OSM primitive has a tag 'voltage'.
    738      *
    739      * @param osmPrimitive
    740      *            The OSM entity to check.
     693     * @param osmPrimitive The OSM entity to check.
    741694     */
    742695    public static boolean hasVoltageTag(OsmPrimitive osmPrimitive) {
     
    746699    /**
    747700     * Gets the value of tag 'voltage'.
    748      *
    749      * @param osmPrimitive
    750      *            The OSM entity to check.
     701     * @param osmPrimitive The OSM entity to check.
    751702     */
    752703    public static String getVoltageValue(OsmPrimitive osmPrimitive) {
     
    756707    /**
    757708     * Check if OSM primitive has a tag 'bridge'.
    758      *
    759      * @param osmPrimitive
    760      *            The OSM entity to check.
     709     * @param osmPrimitive The OSM entity to check.
    761710     */
    762711    public static boolean hasBridgeTag(OsmPrimitive osmPrimitive) {
     
    766715    /**
    767716     * Gets the value of tag 'bridge'.
    768      *
    769      * @param osmPrimitive
    770      *            The OSM entity to check.
     717     * @param osmPrimitive The OSM entity to check.
    771718     */
    772719    public static String getBridgeValue(OsmPrimitive osmPrimitive) {
     
    776723    /**
    777724     * Check if OSM primitive has a tag 'motor_vehicle'.
    778      *
    779      * @param osmPrimitive
    780      *            The OSM entity to check.
     725     * @param osmPrimitive The OSM entity to check.
    781726     */
    782727    public static boolean hasMotorVehicleTag(OsmPrimitive osmPrimitive) {
    783         return osmPrimitive != null ? osmPrimitive.hasKey(MOTOR_VEHICLE_TAG)
    784                 : false;
     728        return osmPrimitive != null ? osmPrimitive.hasKey(MOTOR_VEHICLE_TAG) : false;
    785729    }
    786730
    787731    /**
    788732     * Gets the value of tag 'motor_vehicle'.
    789      *
    790      * @param osmPrimitive
    791      *            The OSM entity to check.
     733     * @param osmPrimitive The OSM entity to check.
    792734     */
    793735    public static String getMotorVehicleValue(OsmPrimitive osmPrimitive) {
    794         return osmPrimitive != null ? osmPrimitive.get(MOTOR_VEHICLE_TAG)
    795                 : null;
     736        return osmPrimitive != null ? osmPrimitive.get(MOTOR_VEHICLE_TAG) : null;
    796737    }
    797738
    798739    /**
    799740     * Check if OSM primitive has a tag 'comment'.
    800      *
    801      * @param osmPrimitive
    802      *            The OSM entity to check.
     741     * @param osmPrimitive The OSM entity to check.
    803742     */
    804743    public static boolean hasCommentTag(OsmPrimitive osmPrimitive) {
     
    808747    /**
    809748     * Gets the value of tag 'comment'.
    810      *
    811      * @param osmPrimitive
    812      *            The OSM entity to check.
     749     * @param osmPrimitive The OSM entity to check.
    813750     */
    814751    public static String getCommentValue(OsmPrimitive osmPrimitive) {
     
    818755    /**
    819756     * Check if OSM primitive has a tag 'maxspeed'.
    820      *
    821      * @param osmPrimitive
    822      *            The OSM entity to check.
     757     * @param osmPrimitive The OSM entity to check.
    823758     */
    824759    public static boolean hasMaxspeedTag(OsmPrimitive osmPrimitive) {
     
    828763    /**
    829764     * Gets the value of tag 'maxspeed'.
    830      *
    831      * @param osmPrimitive
    832      *            The OSM entity to check.
     765     * @param osmPrimitive The OSM entity to check.
    833766     */
    834767    public static String getMaxspeedValue(OsmPrimitive osmPrimitive) {
     
    838771    /**
    839772     * Check if OSM primitive has a tag 'natural'.
    840      *
    841      * @param osmPrimitive
    842      *            The OSM entity to check.
     773     * @param osmPrimitive The OSM entity to check.
    843774     */
    844775    public static boolean hasNaturalTag(OsmPrimitive osmPrimitive) {
     
    848779    /**
    849780     * Gets the value of tag 'natural'.
    850      *
    851      * @param osmPrimitive
    852      *            The OSM entity to check.
     781     * @param osmPrimitive The OSM entity to check.
    853782     */
    854783    public static String getNaturalValue(OsmPrimitive osmPrimitive) {
     
    858787    /**
    859788     * Check if OSM primitive has a tag 'sac_scale'.
    860      *
    861      * @param osmPrimitive
    862      *            The OSM entity to check.
     789     * @param osmPrimitive The OSM entity to check.
    863790     */
    864791    public static boolean hasSacScaleTag(OsmPrimitive osmPrimitive) {
    865         return osmPrimitive != null ? osmPrimitive.hasKey(SAC_SCALE_TAG)
    866                 : false;
     792        return osmPrimitive != null ? osmPrimitive.hasKey(SAC_SCALE_TAG) : false;
    867793    }
    868794
    869795    /**
    870796     * Gets the value of tag 'sac_scale'.
    871      *
    872      * @param osmPrimitive
    873      *            The OSM entity to check.
     797     * @param osmPrimitive The OSM entity to check.
    874798     */
    875799    public static String getSacScaleValue(OsmPrimitive osmPrimitive) {
     
    879803    /**
    880804     * Check if OSM primitive has a tag 'tunnel'.
    881      *
    882      * @param osmPrimitive
    883      *            The OSM entity to check.
     805     * @param osmPrimitive The OSM entity to check.
    884806     */
    885807    public static boolean hasTunnelTag(OsmPrimitive osmPrimitive) {
     
    889811    /**
    890812     * Gets the value of tag 'tunnel'.
    891      *
    892      * @param osmPrimitive
    893      *            The OSM entity to check.
     813     * @param osmPrimitive The OSM entity to check.
    894814     */
    895815    public static String getTunnelValue(OsmPrimitive osmPrimitive) {
     
    899819    /**
    900820     * Check if OSM primitive has a tag 'waterway'.
    901      *
    902      * @param osmPrimitive
    903      *            The OSM entity to check.
     821     * @param osmPrimitive The OSM entity to check.
    904822     */
    905823    public static boolean hasWaterwayTag(OsmPrimitive osmPrimitive) {
     
    909827    /**
    910828     * Gets the value of tag 'waterway'.
    911      *
    912      * @param osmPrimitive
    913      *            The OSM entity to check.
     829     * @param osmPrimitive The OSM entity to check.
    914830     */
    915831    public static String getWaterwayValue(OsmPrimitive osmPrimitive) {
     
    919835    /**
    920836     * Check if OSM primitive has a tag 'trail_visibility'.
    921      *
    922      * @param osmPrimitive
    923      *            The OSM entity to check.
     837     * @param osmPrimitive The OSM entity to check.
    924838     */
    925839    public static boolean hasTrailVisibilityTag(OsmPrimitive osmPrimitive) {
    926         return osmPrimitive != null ? osmPrimitive.hasKey(TRAIL_VISIBILITY_TAG)
    927                 : false;
     840        return osmPrimitive != null ? osmPrimitive.hasKey(TRAIL_VISIBILITY_TAG) : false;
    928841    }
    929842
    930843    /**
    931844     * Gets the value of tag 'trail_visibility'.
    932      *
    933      * @param osmPrimitive
    934      *            The OSM entity to check.
     845     * @param osmPrimitive The OSM entity to check.
    935846     */
    936847    public static String getTrailVisibilityValue(OsmPrimitive osmPrimitive) {
    937         return osmPrimitive != null ? osmPrimitive.get(TRAIL_VISIBILITY_TAG)
    938                 : null;
     848        return osmPrimitive != null ? osmPrimitive.get(TRAIL_VISIBILITY_TAG) : null;
    939849    }
    940850
    941851    /**
    942852     * Check if OSM primitive has a tag 'highway'.
    943      *
    944      * @param osmPrimitive
    945      *            The OSM entity to check.
     853     * @param osmPrimitive The OSM entity to check.
    946854     */
    947855    public static boolean hasHighwayTag(OsmPrimitive osmPrimitive) {
     
    951859    /**
    952860     * Gets the value of tag 'highway'.
    953      *
    954      * @param osmPrimitive
    955      *            The OSM entity to check.
     861     * @param osmPrimitive The OSM entity to check.
    956862     */
    957863    public static String getHighwayValue(OsmPrimitive osmPrimitive) {
     
    961867    /**
    962868     * Check if OSM primitive has a tag 'vehicle'.
    963      *
    964      * @param osmPrimitive
    965      *            The OSM entity to check.
     869     * @param osmPrimitive The OSM entity to check.
    966870     */
    967871    public static boolean hasVehicleTag(OsmPrimitive osmPrimitive) {
     
    971875    /**
    972876     * Gets the value of tag 'vehicle'.
    973      *
    974      * @param osmPrimitive
    975      *            The OSM entity to check.
     877     * @param osmPrimitive The OSM entity to check.
    976878     */
    977879    public static String getVehicleValue(OsmPrimitive osmPrimitive) {
     
    981883    /**
    982884     * Check if OSM primitive has a tag 'horse'.
    983      *
    984      * @param osmPrimitive
    985      *            The OSM entity to check.
     885     * @param osmPrimitive The OSM entity to check.
    986886     */
    987887    public static boolean hasHorseTag(OsmPrimitive osmPrimitive) {
     
    991891    /**
    992892     * Gets the value of tag 'horse'.
    993      *
    994      * @param osmPrimitive
    995      *            The OSM entity to check.
     893     * @param osmPrimitive The OSM entity to check.
    996894     */
    997895    public static String getHorseValue(OsmPrimitive osmPrimitive) {
     
    1001899    /**
    1002900     * Check if OSM primitive has a tag 'goods'.
    1003      *
    1004      * @param osmPrimitive
    1005      *            The OSM entity to check.
     901     * @param osmPrimitive The OSM entity to check.
    1006902     */
    1007903    public static boolean hasGoodsTag(OsmPrimitive osmPrimitive) {
     
    1011907    /**
    1012908     * Gets the value of tag 'goods'.
    1013      *
    1014      * @param osmPrimitive
    1015      *            The OSM entity to check.
     909     * @param osmPrimitive The OSM entity to check.
    1016910     */
    1017911    public static String getGoodsValue(OsmPrimitive osmPrimitive) {
     
    1021915    /**
    1022916     * Check if OSM primitive has a tag 'frequency'.
    1023      *
    1024      * @param osmPrimitive
    1025      *            The OSM entity to check.
     917     * @param osmPrimitive The OSM entity to check.
    1026918     */
    1027919    public static boolean hasFrequencyTag(OsmPrimitive osmPrimitive) {
    1028         return osmPrimitive != null ? osmPrimitive.hasKey(FREQUENCY_TAG)
    1029                 : false;
     920        return osmPrimitive != null ? osmPrimitive.hasKey(FREQUENCY_TAG) : false;
    1030921    }
    1031922
    1032923    /**
    1033924     * Gets the value of tag 'frequency'.
    1034      *
    1035      * @param osmPrimitive
    1036      *            The OSM entity to check.
     925     * @param osmPrimitive The OSM entity to check.
    1037926     */
    1038927    public static String getFrequencyValue(OsmPrimitive osmPrimitive) {
     
    1042931    /**
    1043932     * Check if OSM primitive has a tag 'man_made'.
    1044      *
    1045      * @param osmPrimitive
    1046      *            The OSM entity to check.
     933     * @param osmPrimitive The OSM entity to check.
    1047934     */
    1048935    public static boolean hasManMadeTag(OsmPrimitive osmPrimitive) {
     
    1052939    /**
    1053940     * Gets the value of tag 'man_made'.
    1054      *
    1055      * @param osmPrimitive
    1056      *            The OSM entity to check.
     941     * @param osmPrimitive The OSM entity to check.
    1057942     */
    1058943    public static String getManMadeValue(OsmPrimitive osmPrimitive) {
     
    1062947    /**
    1063948     * Check if OSM primitive has a tag 'addr:housenumber'.
    1064      *
    1065      * @param osmPrimitive
    1066      *            The OSM entity to check.
     949     * @param osmPrimitive The OSM entity to check.
    1067950     */
    1068951    public static boolean hasAddrHousenumberTag(OsmPrimitive osmPrimitive) {
    1069         return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENUMBER_TAG)
    1070                 : false;
     952        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENUMBER_TAG) : false;
    1071953    }
    1072954
    1073955    /**
    1074956     * Gets the value of tag 'addr:housenumber'.
    1075      *
    1076      * @param osmPrimitive
    1077      *            The OSM entity to check.
     957     * @param osmPrimitive The OSM entity to check.
    1078958     */
    1079959    public static String getAddrHousenumberValue(OsmPrimitive osmPrimitive) {
    1080         return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENUMBER_TAG)
    1081                 : null;
     960        return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENUMBER_TAG) : null;
    1082961    }
    1083962
    1084963    /**
    1085964     * Check if OSM primitive has a tag 'addr:housename'.
    1086      *
    1087      * @param osmPrimitive
    1088      *            The OSM entity to check.
     965     * @param osmPrimitive The OSM entity to check.
    1089966     */
    1090967    public static boolean hasAddrHousenameTag(OsmPrimitive osmPrimitive) {
    1091         return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENAME_TAG)
    1092                 : false;
     968        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_HOUSENAME_TAG) : false;
    1093969    }
    1094970
    1095971    /**
    1096972     * Gets the value of tag 'addr:housename'.
    1097      *
    1098      * @param osmPrimitive
    1099      *            The OSM entity to check.
     973     * @param osmPrimitive The OSM entity to check.
    1100974     */
    1101975    public static String getAddrHousenameValue(OsmPrimitive osmPrimitive) {
    1102         return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENAME_TAG)
    1103                 : null;
     976        return osmPrimitive != null ? osmPrimitive.get(ADDR_HOUSENAME_TAG) : null;
    1104977    }
    1105978
    1106979    /**
    1107980     * Check if OSM primitive has a tag 'area'.
    1108      *
    1109      * @param osmPrimitive
    1110      *            The OSM entity to check.
     981     * @param osmPrimitive The OSM entity to check.
    1111982     */
    1112983    public static boolean hasAreaTag(OsmPrimitive osmPrimitive) {
     
    1116987    /**
    1117988     * Gets the value of tag 'area'.
    1118      *
    1119      * @param osmPrimitive
    1120      *            The OSM entity to check.
     989     * @param osmPrimitive The OSM entity to check.
    1121990     */
    1122991    public static String getAreaValue(OsmPrimitive osmPrimitive) {
     
    1126995    /**
    1127996     * Check if OSM primitive has a tag 'building:levels'.
    1128      *
    1129      * @param osmPrimitive
    1130      *            The OSM entity to check.
     997     * @param osmPrimitive The OSM entity to check.
    1131998     */
    1132999    public static boolean hasBuildingLevelsTag(OsmPrimitive osmPrimitive) {
    1133         return osmPrimitive != null ? osmPrimitive.hasKey(BUILDING_LEVELS_TAG)
    1134                 : false;
     1000        return osmPrimitive != null ? osmPrimitive.hasKey(BUILDING_LEVELS_TAG) : false;
    11351001    }
    11361002
    11371003    /**
    11381004     * Gets the value of tag 'building:levels'.
    1139      *
    1140      * @param osmPrimitive
    1141      *            The OSM entity to check.
     1005     * @param osmPrimitive The OSM entity to check.
    11421006     */
    11431007    public static String getBuildingLevelsValue(OsmPrimitive osmPrimitive) {
    1144         return osmPrimitive != null ? osmPrimitive.get(BUILDING_LEVELS_TAG)
    1145                 : null;
     1008        return osmPrimitive != null ? osmPrimitive.get(BUILDING_LEVELS_TAG) : null;
    11461009    }
    11471010
    11481011    /**
    11491012     * Check if OSM primitive has a tag 'wheelchair'.
    1150      *
    1151      * @param osmPrimitive
    1152      *            The OSM entity to check.
     1013     * @param osmPrimitive The OSM entity to check.
    11531014     */
    11541015    public static boolean hasWheelchairTag(OsmPrimitive osmPrimitive) {
    1155         return osmPrimitive != null ? osmPrimitive.hasKey(WHEELCHAIR_TAG)
    1156                 : false;
     1016        return osmPrimitive != null ? osmPrimitive.hasKey(WHEELCHAIR_TAG) : false;
    11571017    }
    11581018
    11591019    /**
    11601020     * Gets the value of tag 'wheelchair'.
    1161      *
    1162      * @param osmPrimitive
    1163      *            The OSM entity to check.
     1021     * @param osmPrimitive The OSM entity to check.
    11641022     */
    11651023    public static String getWheelchairValue(OsmPrimitive osmPrimitive) {
     
    11691027    /**
    11701028     * Check if OSM primitive has a tag 'name'.
    1171      *
    1172      * @param osmPrimitive
    1173      *            The OSM entity to check.
     1029     * @param osmPrimitive The OSM entity to check.
    11741030     */
    11751031    public static boolean hasNameTag(OsmPrimitive osmPrimitive) {
     
    11791035    /**
    11801036     * Gets the value of tag 'name'.
    1181      *
    1182      * @param osmPrimitive
    1183      *            The OSM entity to check.
     1037     * @param osmPrimitive The OSM entity to check.
    11841038     */
    11851039    public static String getNameValue(OsmPrimitive osmPrimitive) {
     
    11891043    /**
    11901044     * Check if OSM primitive has a tag 'oneway'.
    1191      *
    1192      * @param osmPrimitive
    1193      *            The OSM entity to check.
     1045     * @param osmPrimitive The OSM entity to check.
    11941046     */
    11951047    public static boolean hasOnewayTag(OsmPrimitive osmPrimitive) {
     
    11991051    /**
    12001052     * Gets the value of tag 'oneway'.
    1201      *
    1202      * @param osmPrimitive
    1203      *            The OSM entity to check.
     1053     * @param osmPrimitive The OSM entity to check.
    12041054     */
    12051055    public static String getOnewayValue(OsmPrimitive osmPrimitive) {
     
    12091059    /**
    12101060     * Check if OSM primitive has a tag 'FIXME'.
    1211      *
    1212      * @param osmPrimitive
    1213      *            The OSM entity to check.
     1061     * @param osmPrimitive The OSM entity to check.
    12141062     */
    12151063    public static boolean hasFIXMETag(OsmPrimitive osmPrimitive) {
     
    12191067    /**
    12201068     * Gets the value of tag 'FIXME'.
    1221      *
    1222      * @param osmPrimitive
    1223      *            The OSM entity to check.
     1069     * @param osmPrimitive The OSM entity to check.
    12241070     */
    12251071    public static String getFIXMEValue(OsmPrimitive osmPrimitive) {
     
    12291075    /**
    12301076     * Check if OSM primitive has a tag 'capacity'.
    1231      *
    1232      * @param osmPrimitive
    1233      *            The OSM entity to check.
     1077     * @param osmPrimitive The OSM entity to check.
    12341078     */
    12351079    public static boolean hasCapacityTag(OsmPrimitive osmPrimitive) {
     
    12391083    /**
    12401084     * Gets the value of tag 'capacity'.
    1241      *
    1242      * @param osmPrimitive
    1243      *            The OSM entity to check.
     1085     * @param osmPrimitive The OSM entity to check.
    12441086     */
    12451087    public static String getCapacityValue(OsmPrimitive osmPrimitive) {
     
    12491091    /**
    12501092     * Check if OSM primitive has a tag 'motorcycle'.
    1251      *
    1252      * @param osmPrimitive
    1253      *            The OSM entity to check.
     1093     * @param osmPrimitive The OSM entity to check.
    12541094     */
    12551095    public static boolean hasMotorcycleTag(OsmPrimitive osmPrimitive) {
    1256         return osmPrimitive != null ? osmPrimitive.hasKey(MOTORCYCLE_TAG)
    1257                 : false;
     1096        return osmPrimitive != null ? osmPrimitive.hasKey(MOTORCYCLE_TAG) : false;
    12581097    }
    12591098
    12601099    /**
    12611100     * Gets the value of tag 'motorcycle'.
    1262      *
    1263      * @param osmPrimitive
    1264      *            The OSM entity to check.
     1101     * @param osmPrimitive The OSM entity to check.
    12651102     */
    12661103    public static String getMotorcycleValue(OsmPrimitive osmPrimitive) {
     
    12701107    /**
    12711108     * Check if OSM primitive has a tag 'hgv'.
    1272      *
    1273      * @param osmPrimitive
    1274      *            The OSM entity to check.
     1109     * @param osmPrimitive The OSM entity to check.
    12751110     */
    12761111    public static boolean hasHgvTag(OsmPrimitive osmPrimitive) {
     
    12801115    /**
    12811116     * Gets the value of tag 'hgv'.
    1282      *
    1283      * @param osmPrimitive
    1284      *            The OSM entity to check.
     1117     * @param osmPrimitive The OSM entity to check.
    12851118     */
    12861119    public static String getHgvValue(OsmPrimitive osmPrimitive) {
     
    12901123    /**
    12911124     * Check if OSM primitive has a tag 'construction'.
    1292      *
    1293      * @param osmPrimitive
    1294      *            The OSM entity to check.
     1125     * @param osmPrimitive The OSM entity to check.
    12951126     */
    12961127    public static boolean hasConstructionTag(OsmPrimitive osmPrimitive) {
    1297         return osmPrimitive != null ? osmPrimitive.hasKey(CONSTRUCTION_TAG)
    1298                 : false;
     1128        return osmPrimitive != null ? osmPrimitive.hasKey(CONSTRUCTION_TAG) : false;
    12991129    }
    13001130
    13011131    /**
    13021132     * Gets the value of tag 'construction'.
    1303      *
    1304      * @param osmPrimitive
    1305      *            The OSM entity to check.
     1133     * @param osmPrimitive The OSM entity to check.
    13061134     */
    13071135    public static String getConstructionValue(OsmPrimitive osmPrimitive) {
     
    13111139    /**
    13121140     * Check if OSM primitive has a tag 'addr:state'.
    1313      *
    1314      * @param osmPrimitive
    1315      *            The OSM entity to check.
     1141     * @param osmPrimitive The OSM entity to check.
    13161142     */
    13171143    public static boolean hasAddrStateTag(OsmPrimitive osmPrimitive) {
    1318         return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_STATE_TAG)
    1319                 : false;
     1144        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_STATE_TAG) : false;
    13201145    }
    13211146
    13221147    /**
    13231148     * Gets the value of tag 'addr:state'.
    1324      *
    1325      * @param osmPrimitive
    1326      *            The OSM entity to check.
     1149     * @param osmPrimitive The OSM entity to check.
    13271150     */
    13281151    public static String getAddrStateValue(OsmPrimitive osmPrimitive) {
     
    13321155    /**
    13331156     * Check if OSM primitive has a tag 'lanes'.
    1334      *
    1335      * @param osmPrimitive
    1336      *            The OSM entity to check.
     1157     * @param osmPrimitive The OSM entity to check.
    13371158     */
    13381159    public static boolean hasLanesTag(OsmPrimitive osmPrimitive) {
     
    13421163    /**
    13431164     * Gets the value of tag 'lanes'.
    1344      *
    1345      * @param osmPrimitive
    1346      *            The OSM entity to check.
     1165     * @param osmPrimitive The OSM entity to check.
    13471166     */
    13481167    public static String getLanesValue(OsmPrimitive osmPrimitive) {
     
    13521171    /**
    13531172     * Check if OSM primitive has a tag 'note'.
    1354      *
    1355      * @param osmPrimitive
    1356      *            The OSM entity to check.
     1173     * @param osmPrimitive The OSM entity to check.
    13571174     */
    13581175    public static boolean hasNoteTag(OsmPrimitive osmPrimitive) {
     
    13621179    /**
    13631180     * Gets the value of tag 'note'.
    1364      *
    1365      * @param osmPrimitive
    1366      *            The OSM entity to check.
     1181     * @param osmPrimitive The OSM entity to check.
    13671182     */
    13681183    public static String getNoteValue(OsmPrimitive osmPrimitive) {
     
    13721187    /**
    13731188     * Check if OSM primitive has a tag 'lit'.
    1374      *
    1375      * @param osmPrimitive
    1376      *            The OSM entity to check.
     1189     * @param osmPrimitive The OSM entity to check.
    13771190     */
    13781191    public static boolean hasLitTag(OsmPrimitive osmPrimitive) {
     
    13821195    /**
    13831196     * Gets the value of tag 'lit'.
    1384      *
    1385      * @param osmPrimitive
    1386      *            The OSM entity to check.
     1197     * @param osmPrimitive The OSM entity to check.
    13871198     */
    13881199    public static String getLitValue(OsmPrimitive osmPrimitive) {
     
    13921203    /**
    13931204     * Check if OSM primitive has a tag 'building'.
    1394      *
    1395      * @param osmPrimitive
    1396      *            The OSM entity to check.
     1205     * @param osmPrimitive The OSM entity to check.
    13971206     */
    13981207    public static boolean hasBuildingTag(OsmPrimitive osmPrimitive) {
     
    14021211    /**
    14031212     * Gets the value of tag 'building'.
    1404      *
    1405      * @param osmPrimitive
    1406      *            The OSM entity to check.
     1213     * @param osmPrimitive The OSM entity to check.
    14071214     */
    14081215    public static String getBuildingValue(OsmPrimitive osmPrimitive) {
     
    14121219    /**
    14131220     * Check if OSM primitive has a tag 'segregated'.
    1414      *
    1415      * @param osmPrimitive
    1416      *            The OSM entity to check.
     1221     * @param osmPrimitive The OSM entity to check.
    14171222     */
    14181223    public static boolean hasSegregatedTag(OsmPrimitive osmPrimitive) {
    1419         return osmPrimitive != null ? osmPrimitive.hasKey(SEGREGATED_TAG)
    1420                 : false;
     1224        return osmPrimitive != null ? osmPrimitive.hasKey(SEGREGATED_TAG) : false;
    14211225    }
    14221226
    14231227    /**
    14241228     * Gets the value of tag 'segregated'.
    1425      *
    1426      * @param osmPrimitive
    1427      *            The OSM entity to check.
     1229     * @param osmPrimitive The OSM entity to check.
    14281230     */
    14291231    public static String getSegregatedValue(OsmPrimitive osmPrimitive) {
     
    14331235    /**
    14341236     * Check if OSM primitive has a tag 'addr:inclusion'.
    1435      *
    1436      * @param osmPrimitive
    1437      *            The OSM entity to check.
     1237     * @param osmPrimitive The OSM entity to check.
    14381238     */
    14391239    public static boolean hasAddrInclusionTag(OsmPrimitive osmPrimitive) {
    1440         return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_INCLUSION_TAG)
    1441                 : false;
     1240        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_INCLUSION_TAG) : false;
    14421241    }
    14431242
    14441243    /**
    14451244     * Gets the value of tag 'addr:inclusion'.
    1446      *
    1447      * @param osmPrimitive
    1448      *            The OSM entity to check.
     1245     * @param osmPrimitive The OSM entity to check.
    14491246     */
    14501247    public static String getAddrInclusionValue(OsmPrimitive osmPrimitive) {
    1451         return osmPrimitive != null ? osmPrimitive.get(ADDR_INCLUSION_TAG)
    1452                 : null;
     1248        return osmPrimitive != null ? osmPrimitive.get(ADDR_INCLUSION_TAG) : null;
    14531249    }
    14541250
    14551251    /**
    14561252     * Check if OSM primitive has a tag 'layer'.
    1457      *
    1458      * @param osmPrimitive
    1459      *            The OSM entity to check.
     1253     * @param osmPrimitive The OSM entity to check.
    14601254     */
    14611255    public static boolean hasLayerTag(OsmPrimitive osmPrimitive) {
     
    14651259    /**
    14661260     * Gets the value of tag 'layer'.
    1467      *
    1468      * @param osmPrimitive
    1469      *            The OSM entity to check.
     1261     * @param osmPrimitive The OSM entity to check.
    14701262     */
    14711263    public static String getLayerValue(OsmPrimitive osmPrimitive) {
     
    14751267    /**
    14761268     * Check if OSM primitive has a tag 'sport'.
    1477      *
    1478      * @param osmPrimitive
    1479      *            The OSM entity to check.
     1269     * @param osmPrimitive The OSM entity to check.
    14801270     */
    14811271    public static boolean hasSportTag(OsmPrimitive osmPrimitive) {
     
    14851275    /**
    14861276     * Gets the value of tag 'sport'.
    1487      *
    1488      * @param osmPrimitive
    1489      *            The OSM entity to check.
     1277     * @param osmPrimitive The OSM entity to check.
    14901278     */
    14911279    public static String getSportValue(OsmPrimitive osmPrimitive) {
     
    14951283    /**
    14961284     * Check if OSM primitive has a tag 'addr:interpolation'.
    1497      *
    1498      * @param osmPrimitive
    1499      *            The OSM entity to check.
     1285     * @param osmPrimitive The OSM entity to check.
    15001286     */
    15011287    public static boolean hasAddrInterpolationTag(OsmPrimitive osmPrimitive) {
    1502         return osmPrimitive != null ? osmPrimitive
    1503                 .hasKey(ADDR_INTERPOLATION_TAG) : false;
     1288        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_INTERPOLATION_TAG) : false;
    15041289    }
    15051290
    15061291    /**
    15071292     * Gets the value of tag 'addr:interpolation'.
    1508      *
    1509      * @param osmPrimitive
    1510      *            The OSM entity to check.
     1293     * @param osmPrimitive The OSM entity to check.
    15111294     */
    15121295    public static String getAddrInterpolationValue(OsmPrimitive osmPrimitive) {
    1513         return osmPrimitive != null ? osmPrimitive.get(ADDR_INTERPOLATION_TAG)
    1514                 : null;
     1296        return osmPrimitive != null ? osmPrimitive.get(ADDR_INTERPOLATION_TAG) : null;
    15151297    }
    15161298
    15171299    /**
    15181300     * Check if OSM primitive has a tag 'cutting'.
    1519      *
    1520      * @param osmPrimitive
    1521      *            The OSM entity to check.
     1301     * @param osmPrimitive The OSM entity to check.
    15221302     */
    15231303    public static boolean hasCuttingTag(OsmPrimitive osmPrimitive) {
     
    15271307    /**
    15281308     * Gets the value of tag 'cutting'.
    1529      *
    1530      * @param osmPrimitive
    1531      *            The OSM entity to check.
     1309     * @param osmPrimitive The OSM entity to check.
    15321310     */
    15331311    public static String getCuttingValue(OsmPrimitive osmPrimitive) {
     
    15371315    /**
    15381316     * Check if OSM primitive has a tag 'amenity'.
    1539      *
    1540      * @param osmPrimitive
    1541      *            The OSM entity to check.
     1317     * @param osmPrimitive The OSM entity to check.
    15421318     */
    15431319    public static boolean hasAmenityTag(OsmPrimitive osmPrimitive) {
     
    15471323    /**
    15481324     * Gets the value of tag 'amenity'.
    1549      *
    1550      * @param osmPrimitive
    1551      *            The OSM entity to check.
     1325     * @param osmPrimitive The OSM entity to check.
    15521326     */
    15531327    public static String getAmenityValue(OsmPrimitive osmPrimitive) {
     
    15571331    /**
    15581332     * Check if OSM primitive has a tag 'access'.
    1559      *
    1560      * @param osmPrimitive
    1561      *            The OSM entity to check.
     1333     * @param osmPrimitive The OSM entity to check.
    15621334     */
    15631335    public static boolean hasAccessTag(OsmPrimitive osmPrimitive) {
     
    15671339    /**
    15681340     * Gets the value of tag 'access'.
    1569      *
    1570      * @param osmPrimitive
    1571      *            The OSM entity to check.
     1341     * @param osmPrimitive The OSM entity to check.
    15721342     */
    15731343    public static String getAccessValue(OsmPrimitive osmPrimitive) {
     
    15771347    /**
    15781348     * Check if OSM primitive has a tag 'agricultural'.
    1579      *
    1580      * @param osmPrimitive
    1581      *            The OSM entity to check.
     1349     * @param osmPrimitive The OSM entity to check.
    15821350     */
    15831351    public static boolean hasAgriculturalTag(OsmPrimitive osmPrimitive) {
     
    15881356    /**
    15891357     * Gets the value of tag 'agricultural'.
    1590      *
    1591      * @param osmPrimitive
    1592      *            The OSM entity to check.
     1358     * @param osmPrimitive The OSM entity to check.
    15931359     */
    15941360    public static String getAgriculturalValue(OsmPrimitive osmPrimitive) {
     
    15981364    /**
    15991365     * Check if OSM primitive has a tag 'capacity:disabled'.
    1600      *
    1601      * @param osmPrimitive
    1602      *            The OSM entity to check.
     1366     * @param osmPrimitive The OSM entity to check.
    16031367     */
    16041368    public static boolean hasCapacityDisabledTag(OsmPrimitive osmPrimitive) {
     
    16091373    /**
    16101374     * Gets the value of tag 'capacity:disabled'.
    1611      *
    1612      * @param osmPrimitive
    1613      *            The OSM entity to check.
     1375     * @param osmPrimitive The OSM entity to check.
    16141376     */
    16151377    public static String getCapacityDisabledValue(OsmPrimitive osmPrimitive) {
    1616         return osmPrimitive != null ? osmPrimitive.get(CAPACITY_DISABLED_TAG)
    1617                 : null;
     1378        return osmPrimitive != null ? osmPrimitive.get(CAPACITY_DISABLED_TAG) : null;
    16181379    }
    16191380
    16201381    /**
    16211382     * Check if OSM primitive has a tag 'operator'.
    1622      *
    1623      * @param osmPrimitive
    1624      *            The OSM entity to check.
     1383     * @param osmPrimitive The OSM entity to check.
    16251384     */
    16261385    public static boolean hasOperatorTag(OsmPrimitive osmPrimitive) {
     
    16301389    /**
    16311390     * Gets the value of tag 'operator'.
    1632      *
    1633      * @param osmPrimitive
    1634      *            The OSM entity to check.
     1391     * @param osmPrimitive The OSM entity to check.
    16351392     */
    16361393    public static String getOperatorValue(OsmPrimitive osmPrimitive) {
     
    16401397    /**
    16411398     * Check if OSM primitive has a tag 'ref'.
    1642      *
    1643      * @param osmPrimitive
    1644      *            The OSM entity to check.
     1399     * @param osmPrimitive The OSM entity to check.
    16451400     */
    16461401    public static boolean hasRefTag(OsmPrimitive osmPrimitive) {
     
    16501405    /**
    16511406     * Gets the value of tag 'ref'.
    1652      *
    1653      * @param osmPrimitive
    1654      *            The OSM entity to check.
     1407     * @param osmPrimitive The OSM entity to check.
    16551408     */
    16561409    public static String getRefValue(OsmPrimitive osmPrimitive) {
     
    16601413    /**
    16611414     * Check if OSM primitive has a tag 'noexit'.
    1662      *
    1663      * @param osmPrimitive
    1664      *            The OSM entity to check.
     1415     * @param osmPrimitive The OSM entity to check.
    16651416     */
    16661417    public static boolean hasNoexitTag(OsmPrimitive osmPrimitive) {
     
    16701421    /**
    16711422     * Gets the value of tag 'noexit'.
    1672      *
    1673      * @param osmPrimitive
    1674      *            The OSM entity to check.
     1423     * @param osmPrimitive The OSM entity to check.
    16751424     */
    16761425    public static String getNoexitValue(OsmPrimitive osmPrimitive) {
     
    16801429    /**
    16811430     * Check if OSM primitive has a tag 'admin_level'.
    1682      *
    1683      * @param osmPrimitive
    1684      *            The OSM entity to check.
     1431     * @param osmPrimitive The OSM entity to check.
    16851432     */
    16861433    public static boolean hasAdminLevelTag(OsmPrimitive osmPrimitive) {
    1687         return osmPrimitive != null ? osmPrimitive.hasKey(ADMIN_LEVEL_TAG)
    1688                 : false;
     1434        return osmPrimitive != null ? osmPrimitive.hasKey(ADMIN_LEVEL_TAG) : false;
    16891435    }
    16901436
    16911437    /**
    16921438     * Gets the value of tag 'admin_level'.
    1693      *
    1694      * @param osmPrimitive
    1695      *            The OSM entity to check.
     1439     * @param osmPrimitive The OSM entity to check.
    16961440     */
    16971441    public static String getAdminLevelValue(OsmPrimitive osmPrimitive) {
     
    17011445    /**
    17021446     * Check if OSM primitive has a tag 'source'.
    1703      *
    1704      * @param osmPrimitive
    1705      *            The OSM entity to check.
     1447     * @param osmPrimitive The OSM entity to check.
    17061448     */
    17071449    public static boolean hasSourceTag(OsmPrimitive osmPrimitive) {
     
    17111453    /**
    17121454     * Gets the value of tag 'source'.
    1713      *
    1714      * @param osmPrimitive
    1715      *            The OSM entity to check.
     1455     * @param osmPrimitive The OSM entity to check.
    17161456     */
    17171457    public static String getSourceValue(OsmPrimitive osmPrimitive) {
     
    17211461    /**
    17221462     * Check if OSM primitive has a tag 'tracktype'.
    1723      *
    1724      * @param osmPrimitive
    1725      *            The OSM entity to check.
     1463     * @param osmPrimitive The OSM entity to check.
    17261464     */
    17271465    public static boolean hasTracktypeTag(OsmPrimitive osmPrimitive) {
    1728         return osmPrimitive != null ? osmPrimitive.hasKey(TRACKTYPE_TAG)
    1729                 : false;
     1466        return osmPrimitive != null ? osmPrimitive.hasKey(TRACKTYPE_TAG) : false;
    17301467    }
    17311468
    17321469    /**
    17331470     * Gets the value of tag 'tracktype'.
    1734      *
    1735      * @param osmPrimitive
    1736      *            The OSM entity to check.
     1471     * @param osmPrimitive The OSM entity to check.
    17371472     */
    17381473    public static String getTracktypeValue(OsmPrimitive osmPrimitive) {
     
    17421477    /**
    17431478     * Check if OSM primitive has a tag 'addr:country'.
    1744      *
    1745      * @param osmPrimitive
    1746      *            The OSM entity to check.
     1479     * @param osmPrimitive The OSM entity to check.
    17471480     */
    17481481    public static boolean hasAddrCountryTag(OsmPrimitive osmPrimitive) {
    1749         return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_COUNTRY_TAG)
    1750                 : false;
     1482        return osmPrimitive != null ? osmPrimitive.hasKey(ADDR_COUNTRY_TAG) : false;
    17511483    }
    17521484
    17531485    /**
    17541486     * Gets the value of tag 'addr:country'.
    1755      *
    1756      * @param osmPrimitive
    1757      *            The OSM entity to check.
     1487     * @param osmPrimitive The OSM entity to check.
    17581488     */
    17591489    public static String getAddrCountryValue(OsmPrimitive osmPrimitive) {
     
    17631493    /**
    17641494     * Check if OSM primitive has a tag 'route'.
    1765      *
    1766      * @param osmPrimitive
    1767      *            The OSM entity to check.
     1495     * @param osmPrimitive The OSM entity to check.
    17681496     */
    17691497    public static boolean hasRouteTag(OsmPrimitive osmPrimitive) {
     
    17731501    /**
    17741502     * Gets the value of tag 'route'.
    1775      *
    1776      * @param osmPrimitive
    1777      *            The OSM entity to check.
     1503     * @param osmPrimitive The OSM entity to check.
    17781504     */
    17791505    public static String getRouteValue(OsmPrimitive osmPrimitive) {
     
    17831509    /**
    17841510     * Check if OSM primitive has a tag 'cables'.
    1785      *
    1786      * @param osmPrimitive
    1787      *            The OSM entity to check.
     1511     * @param osmPrimitive The OSM entity to check.
    17881512     */
    17891513    public static boolean hasCablesTag(OsmPrimitive osmPrimitive) {
     
    17931517    /**
    17941518     * Gets the value of tag 'cables'.
    1795      *
    1796      * @param osmPrimitive
    1797      *            The OSM entity to check.
     1519     * @param osmPrimitive The OSM entity to check.
    17981520     */
    17991521    public static String getCablesValue(OsmPrimitive osmPrimitive) {
     
    18031525    /**
    18041526     * Check if OSM primitive has a tag 'service'.
    1805      *
    1806      * @param osmPrimitive
    1807      *            The OSM entity to check.
     1527     * @param osmPrimitive The OSM entity to check.
    18081528     */
    18091529    public static boolean hasServiceTag(OsmPrimitive osmPrimitive) {
     
    18131533    /**
    18141534     * Gets the value of tag 'service'.
    1815      *
    1816      * @param osmPrimitive
    1817      *            The OSM entity to check.
     1535     * @param osmPrimitive The OSM entity to check.
    18181536     */
    18191537    public static String getServiceValue(OsmPrimitive osmPrimitive) {
     
    18231541    /**
    18241542     * Check if OSM primitive has a tag 'motorcar'.
    1825      *
    1826      * @param osmPrimitive
    1827      *            The OSM entity to check.
     1543     * @param osmPrimitive The OSM entity to check.
    18281544     */
    18291545    public static boolean hasMotorcarTag(OsmPrimitive osmPrimitive) {
     
    18331549    /**
    18341550     * Gets the value of tag 'motorcar'.
    1835      *
    1836      * @param osmPrimitive
    1837      *            The OSM entity to check.
     1551     * @param osmPrimitive The OSM entity to check.
    18381552     */
    18391553    public static String getMotorcarValue(OsmPrimitive osmPrimitive) {
     
    18431557    /**
    18441558     * Check if OSM primitive has a tag 'whitewater'.
    1845      *
    1846      * @param osmPrimitive
    1847      *            The OSM entity to check.
     1559     * @param osmPrimitive The OSM entity to check.
    18481560     */
    18491561    public static boolean hasWhitewaterTag(OsmPrimitive osmPrimitive) {
    1850         return osmPrimitive != null ? osmPrimitive.hasKey(WHITEWATER_TAG)
    1851                 : false;
     1562        return osmPrimitive != null ? osmPrimitive.hasKey(WHITEWATER_TAG) : false;
    18521563    }
    18531564
    18541565    /**
    18551566     * Gets the value of tag 'whitewater'.
    1856      *
    1857      * @param osmPrimitive
    1858      *            The OSM entity to check.
     1567     * @param osmPrimitive The OSM entity to check.
    18591568     */
    18601569    public static String getWhitewaterValue(OsmPrimitive osmPrimitive) {
     
    18641573    /**
    18651574     * Check if OSM primitive has a tag 'embankment'.
    1866      *
    1867      * @param osmPrimitive
    1868      *            The OSM entity to check.
     1575     * @param osmPrimitive The OSM entity to check.
    18691576     */
    18701577    public static boolean hasEmbankmentTag(OsmPrimitive osmPrimitive) {
    1871         return osmPrimitive != null ? osmPrimitive.hasKey(EMBANKMENT_TAG)
    1872                 : false;
     1578        return osmPrimitive != null ? osmPrimitive.hasKey(EMBANKMENT_TAG) : false;
    18731579    }
    18741580
    18751581    /**
    18761582     * Gets the value of tag 'embankment'.
    1877      *
    1878      * @param osmPrimitive
    1879      *            The OSM entity to check.
     1583     * @param osmPrimitive The OSM entity to check.
    18801584     */
    18811585    public static String getEmbankmentValue(OsmPrimitive osmPrimitive) {
     
    19131617    /**
    19141618     * Check if OSM relation is a 'associatedStreet' relation.
    1915      *
    1916      * @param osmPrimitive
    1917      *            The OSM entity to check.
     1619     * @param osmPrimitive The OSM entity to check.
    19181620     */
    19191621    public static boolean isAssociatedStreetRelation(Relation rel) {
     
    19251627    /**
    19261628     * Checks if given relation member has role "street".
    1927      *
    19281629     * @param relMember the relation member
    19291630     * @return true, if is street member
     
    19351636    /**
    19361637     * Checks if given relation member has role "house".
    1937      *
    19381638     * @param relMember the relation member
    19391639     * @return true, if is street member
     
    19451645    /**
    19461646     * Checks if "addr:state" tag is required.
    1947      *
    19481647     * @return true, if is state required
    19491648     */
     
    19591658        return false;
    19601659    }
    1961 
    1962     public static final String PARKING_TAG = "parking";
    1963     public static final String SHOP_TAG = "shop";
    1964     public static final String CRAFT_TAG = "craft";
    1965     public static final String SURFACE_TAG = "surface";
    1966     public static final String CUISINE_TAG = "cuisine";
    1967     public static final String WOOD_TAG = "wood";
    1968     public static final String FOOT_TAG = "foot";
    1969     public static final String NAME_DE_TAG = "name:de";
    1970     public static final String NAT_REF_TAG = "nat_ref";
    1971     public static final String NOTE_DE_TAG = "note:de";
    1972     public static final String ADDR_STREET_TAG = "addr:street";
    1973     public static final String TYPE_TAG = "type";
    1974     public static final String ADDR_CITY_TAG = "addr:city";
    1975     public static final String BOUNDARY_TAG = "boundary";
    1976     public static final String SMOOTHNESS_TAG = "smoothness";
    1977     public static final String OPENING_HOURS_TAG = "opening_hours";
    1978     public static final String BICYCLE_TAG = "bicycle";
    1979     public static final String RELIGION_TAG = "religion";
    1980     public static final String BARRIER_TAG = "barrier";
    1981     public static final String POWER_TAG = "power";
    1982     public static final String LANDUSE_TAG = "landuse";
    1983     public static final String FIREPLACE_TAG = "fireplace";
    1984     public static final String INT_REF_TAG = "int_ref";
    1985     public static final String WHITEWATER_SECTION_GRADE_TAG = "whitewater:section_grade";
    1986     public static final String DENOMINATION_TAG = "denomination";
    1987     public static final String ADDR_POSTCODE_TAG = "addr:postcode";
    1988     public static final String WIRES_TAG = "wires";
    1989     public static final String LOC_REF_TAG = "loc_ref";
    1990     public static final String WIDTH_TAG = "width";
    1991     public static final String TOURISM_TAG = "tourism";
    1992     public static final String LEISURE_TAG = "leisure";
    1993     public static final String ELECTRIFIED_TAG = "electrified";
    1994     public static final String JUNCTION_TAG = "junction";
    1995     public static final String RAILWAY_TAG = "railway";
    1996     public static final String VOLTAGE_TAG = "voltage";
    1997     public static final String BRIDGE_TAG = "bridge";
    1998     public static final String MOTOR_VEHICLE_TAG = "motor_vehicle";
    1999     public static final String COMMENT_TAG = "comment";
    2000     public static final String MAXSPEED_TAG = "maxspeed";
    2001     public static final String NATURAL_TAG = "natural";
    2002     public static final String BUILDING_HEIGHT_TAG = "building:height";
    2003     public static final String SAC_SCALE_TAG = "sac_scale";
    2004     public static final String TUNNEL_TAG = "tunnel";
    2005     public static final String WATERWAY_TAG = "waterway";
    2006     public static final String TRAIL_VISIBILITY_TAG = "trail_visibility";
    2007     public static final String HIGHWAY_TAG = "highway";
    2008     public static final String VEHICLE_TAG = "vehicle";
    2009     public static final String HORSE_TAG = "horse";
    2010     public static final String GOODS_TAG = "goods";
    2011     public static final String FREQUENCY_TAG = "frequency";
    2012     public static final String MAN_MADE_TAG = "man_made";
    2013     public static final String ADDR_HOUSENUMBER_TAG = "addr:housenumber";
    2014     public static final String AREA_TAG = "area";
    2015     public static final String BUILDING_LEVELS_TAG = "building:levels";
    2016     public static final String WHEELCHAIR_TAG = "wheelchair";
    2017     public static final String NAME_TAG = "name";
    2018     public static final String ONEWAY_TAG = "oneway";
    2019     public static final String FIXME_TAG = "FIXME";
    2020     public static final String CAPACITY_TAG = "capacity";
    2021     public static final String MOTORCYCLE_TAG = "motorcycle";
    2022     public static final String HGV_TAG = "hgv";
    2023     public static final String CONSTRUCTION_TAG = "construction";
    2024     public static final String ADDR_STATE_TAG = "addr:state";
    2025     public static final String LANES_TAG = "lanes";
    2026     public static final String NOTE_TAG = "note";
    2027     public static final String LIT_TAG = "lit";
    2028     public static final String BUILDING_TAG = "building";
    2029     public static final String SEGREGATED_TAG = "segregated";
    2030     public static final String ADDR_INCLUSION_TAG = "addr:inclusion";
    2031     public static final String LAYER_TAG = "layer";
    2032     public static final String SPORT_TAG = "sport";
    2033     public static final String ADDR_INTERPOLATION_TAG = "addr:interpolation";
    2034     public static final String CUTTING_TAG = "cutting";
    2035     public static final String AMENITY_TAG = "amenity";
    2036     public static final String ACCESS_TAG = "access";
    2037     public static final String AGRICULTURAL_TAG = "agricultural";
    2038     public static final String CAPACITY_DISABLED_TAG = "capacity:disabled";
    2039     public static final String OPERATOR_TAG = "operator";
    2040     public static final String REF_TAG = "ref";
    2041     public static final String NOEXIT_TAG = "noexit";
    2042     public static final String ADMIN_LEVEL_TAG = "admin_level";
    2043     public static final String SOURCE_TAG = "source";
    2044     public static final String TRACKTYPE_TAG = "tracktype";
    2045     public static final String ADDR_COUNTRY_TAG = "addr:country";
    2046     public static final String ROUTE_TAG = "route";
    2047     public static final String CABLES_TAG = "cables";
    2048     public static final String SERVICE_TAG = "service";
    2049     public static final String MOTORCAR_TAG = "motorcar";
    2050     public static final String WHITEWATER_TAG = "whitewater";
    2051     public static final String EMBANKMENT_TAG = "embankment";
    2052     public static final String ADDR_HOUSENAME_TAG = "addr:housename";
    2053 
    2054     /* Highway types */
    2055     public static final String HIGHWAY_CYCLEWAY_VALUE = "cycleway";
    2056     public static final String HIGHWAY_FOOTWAY_VALUE = "footway";
    2057     public static final String HIGHWAY_MOTORWAY_LINK_VALUE = "motorway_link";
    2058     public static final String HIGHWAY_MOTORWAY_VALUE = "motorway";
    2059     public static final String HIGHWAY_PATH_VALUE = "path";
    2060     public static final String HIGHWAY_RESIDENTIAL_VALUE = "residential";
    2061     public static final String HIGHWAY_LIVING_STREET_VALUE = "living_street";
    2062     public static final String HIGHWAY_ROAD_VALUE = "road";
    2063     public static final String HIGHWAY_SECONDARY_VALUE = "secondary";
    2064     public static final String HIGHWAY_SERVICE_VALUE = "service";
    2065     public static final String HIGHWAY_STEPS_VALUE = "steps";
    2066     public static final String HIGHWAY_TERTIARY_VALUE = "tertiary";
    2067     public static final String HIGHWAY_TRACK_VALUE = "track";
    2068     public static final String HIGHWAY_TRUNK_LINK_VALUE = "trunk_link";
    2069     public static final String HIGHWAY_TRUNK_VALUE = "trunk";
    2070     public static final String HIGHWAY_UNCLASSIFIED_VALUE = "unclassified";
    2071 
    2072     /* Relation keys */
    2073 
    2074     // Associated street: See http://wiki.openstreetmap.org/wiki/Proposed_features/De:Hausnummern
    2075     public static final String RELATION_TYPE = "type";
    2076     public static final String ASSOCIATEDSTREET_RELATION_TYPE = "associatedStreet";
    2077     public static final String STREET_RELATION_ROLE = "street";
    2078     public static final String HOUSE_RELATION_ROLE = "house";
    20791660}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java

    r32701 r32970  
    7070        AddressActions.getConvertAllToRelationAction()
    7171    };
    72    
     72
    7373    private JLabel streetLabel;
    7474    private JLabel unresolvedAddressesLabel;
    7575    private JMapViewer mapViewer;
    7676
    77 
    78     /**
    79      * @param arg0
    80      * @throws HeadlessException
    81      */
    82     public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException  {
     77    public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException {
    8378        super(JOptionPane.getFrameForComponent(Main.parent), tr("Fix unresolved addresses"), false);
    8479
     
    8681        this.editContainer.addChangedListener(this);
    8782        setLayout(new BorderLayout());
    88         setSize(1024,600);
     83        setSize(1024, 600);
    8984        setLocationRelativeTo(null);
    9085
     
    146141            headerPanel2.setMinimumSize(new Dimension(100, 30));
    147142            headerPanel2.add(unresolvedAddressesLabel);
    148             unresolvedPanel.add(headerPanel2 , BorderLayout.NORTH);
     143            unresolvedPanel.add(headerPanel2, BorderLayout.NORTH);
    149144            unresolvedPanel.setMinimumSize(new Dimension(500, 200));
    150145
    151 
    152146            try {
    153                 JPanel unresolvedButtons = new JPanel(new GridLayout(2,5, 5, 5));
     147                JPanel unresolvedButtons = new JPanel(new GridLayout(2, 5, 5, 5));
    154148                SideButton assign = new SideButton(AddressActions.getResolveAction());
    155149                unresolvedButtons.add(assign);
     
    214208        }
    215209
    216         JPanel buttonPanel = new JPanel(new GridLayout(1,10));
     210        JPanel buttonPanel = new JPanel(new GridLayout(1, 10));
    217211        JButton ok = new JButton(OK_COMMAND, ImageProvider.getIfAvailable(null, "ok"));
    218212        ok.addActionListener(this);
     
    236230     * @param title The title of the header.
    237231     * @param n The number to show in the header.
    238      * @return
     232     * @return created header label
    239233     */
    240234    private JLabel createHeaderLabel(String fmtString, String title, int n) {
    241235        JLabel label = new JLabel(String.format(fmtString, title, n));
    242236        label.setFont(label.getFont().deriveFont(Font.BOLD, label.getFont().getSize() + 2));
    243         label.setBorder(new EmptyBorder(5,2,4,5));
     237        label.setBorder(new EmptyBorder(5, 2, 4, 5));
    244238        return label;
    245239    }
     
    347341     * street name given in the address.
    348342     *
    349      * @author Oliver Wieland <oliver.wieland@online.de>
     343     * @author Oliver Wieland &lt;oliver.wieland@online.de>
    350344     */
    351345    class IncompleteAddressListener implements ListSelectionListener {
     
    383377     * event implements this interface, and the object created
    384378     * with that class is registered with a component using the
    385      * component's <code>addJumpToEntryListener<code> method. When
     379     * component's {@code addJumpToEntryListener} method. When
    386380     * the jumpToEntry event occurs, that object's appropriate
    387381     * method is invoked.
     
    396390         * @param column the column of the table to use for the comparison
    397391         */
    398         public JumpToEntryListener(int column) {
    399             super();
     392        JumpToEntryListener(int column) {
    400393            this.column = column;
    401394        }
     
    403396        @Override
    404397        public void keyPressed(KeyEvent arg0) {
    405             // TODO Auto-generated method stub
    406 
    407398        }
    408399
    409400        @Override
    410401        public void keyReleased(KeyEvent arg0) {
    411             // TODO Auto-generated method stub
    412 
    413402        }
    414403
    415404        @Override
    416405        public void keyTyped(KeyEvent arg0) {
    417             JTable table  = (JTable) arg0.getSource();
     406            JTable table = (JTable) arg0.getSource();
    418407
    419408            if (table == null) return;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java

    r30737 r32970  
    2222    private DefaultMutableTreeNode incompleteRoot;
    2323
    24     /**
    25      * @param streets
    26      * @param unresolvedAddresses
    27      */
    2824    public AddressEditModel(List<OSMStreet> streets,
    2925            List<OSMAddress> unresolvedAddresses) {
     
    7066    /**
    7167     * Gets the tree node containing all unresolved addresses.
    72      * @return
     68     * @return tree node containing all unresolved addresses
    7369     */
    7470    public TreeNode getUnresolvedAddressesTree() {
     
    8985    /**
    9086     * Gets the tree node containing all incomplete addresses.
    91      * @return
     87     * @return tree node containing all incomplete addresses
    9288     */
    9389    public TreeNode getIncompleteAddressesTree() {
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditSelectionEvent.java

    r30737 r32970  
    3333     * @param container The address container instance holding the entities for streets and addresses.
    3434     */
    35     public AddressEditSelectionEvent(Object source, JTable selStreet, JTable unresolvedAddresses, JTable incompleteAddresses, AddressEditContainer container) {
     35    public AddressEditSelectionEvent(Object source, JTable selStreet, JTable unresolvedAddresses, JTable incompleteAddresses,
     36            AddressEditContainer container) {
    3637        super(source, -1, "");
    3738        this.streetTable = selStreet;
     
    4344    /**
    4445     * Gets the street table component.
    45      * @return
     46     * @return the street table component
    4647     */
    4748    public JTable getStreetTable() {
     
    5152    /**
    5253     * Gets the 'unresolved addresses' table component.
    53      * @return
     54     * @return the 'unresolved addresses' table component
    5455     */
    5556    public JTable getUnresolvedAddressTable() {
     
    7576    /**
    7677     * Gets the selected street of the street table.
    77      * @return
     78     * @return the selected street of the street table
    7879     */
    7980    public OSMStreet getSelectedStreet() {
     
    144145    /**
    145146     * Gets the list containing the selected items of the 'unresolved addresses ' table.
    146      * @return
     147     * @return the list containing the selected items of the 'unresolved addresses ' table
    147148     */
    148149    public List<OSMAddress> getSelectedUnresolvedAddresses() {
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java

    r32771 r32970  
    3737        } else {
    3838            SwingUtilities.invokeLater(new Runnable() {
    39                
     39
    4040                @Override
    4141                public void run() {
    42                     fireTableDataChanged(); // update model                   
     42                    fireTableDataChanged(); // update model
    4343                }
    4444            });
     
    5555
    5656    /**
    57      * Gets the node entity for the given row or null; if row contains no
    58      * entity.
     57     * Gets the node entity for the given row or null; if row contains no entity.
    5958     *
    6059     * @param row
    6160     *            The row to get the entity object for.
    62      * @return
     61     * @return the node entity for the given row or null; if row contains no entity
    6362     */
    6463    public abstract IOSMEntity getEntityOfRow(int row);
    6564
    6665    /**
    67      * Gets the row for the given node entity or -1; if the model does not
    68      * contain the entity.
     66     * Gets the row for the given node entity or -1; if the model does not contain the entity.
    6967     *
    7068     * @param entity
    7169     *            The entity to get the row for.
    72      * @return
     70     * @return the row for the given node entity or -1; if the model does not contain the entity
    7371     */
    7472    public abstract int getRowOfEntity(IOSMEntity entity);
     
    9088     * event implements this interface, and the object created
    9189     * with that class is registered with a component using the
    92      * component's <code>addColumnListener<code> method. When
     90     * component's {@code addColumnListener} method. When
    9391     * the column event occurs, that object's appropriate
    9492     * method is invoked.
     
    104102         * @param t the t
    105103         */
    106         public ColumnListener(JTable t) {
     104        ColumnListener(JTable t) {
    107105            table = t;
    108106        }
     
    142140     * Internal base class to sort items by different columns.
    143141     */
    144     protected static abstract class ColumnSorter<E> implements Comparator<E> {
     142    protected abstract static class ColumnSorter<E> implements Comparator<E> {
    145143        private int column;
    146144        private boolean ascending;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/BBoxMapRectangle.java

    r30348 r32970  
    1212    private BBox bbox;
    1313
    14     /**
    15      * @param bbox
    16      */
    1714    public BBoxMapRectangle(BBox bbox) {
    1815        super(null, null);
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java

    r32771 r32970  
    1111import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
    1212
    13 public class IncompleteAddressesTableModel extends AddressEditTableModel  {
     13public class IncompleteAddressesTableModel extends AddressEditTableModel {
    1414    /**
    1515     *
     
    1919    // TODO: Add "state" column, if required
    2020    private static final int NUMBER_OF_COLUMNS = 5;
    21     private static final String[] COLUMN_NAMES = new String[]{tr("Country"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Street"), tr("Number")};
    22     private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{
     21    private static final String[] COLUMN_NAMES = new String[] {
     22            tr("Country"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Street"), tr("Number")};
     23    private static final Class<?>[] COLUMN_CLASSES = new Class<?>[] {
    2324        String.class, String.class, String.class, String.class, String.class, String.class};
    2425
     
    125126         * @param asc sort ascending
    126127         */
    127         public IncompleteAddressModelSorter(int column, boolean asc) {
     128        IncompleteAddressModelSorter(int column, boolean asc) {
    128129            super(column, asc);
    129130        }
     
    135136            switch (getColumn()) {
    136137            case 0:
    137                 cc=arg0.getCountry().compareTo(arg1.getCountry());
     138                cc = arg0.getCountry().compareTo(arg1.getCountry());
    138139                break;
    139140            case 1:
    140                 cc=arg0.getCity().compareTo(arg1.getCity());
     141                cc = arg0.getCity().compareTo(arg1.getCity());
    141142                break;
    142143            case 2:
    143                 cc=arg0.getPostalCode().compareTo(arg1.getPostalCode());
     144                cc = arg0.getPostalCode().compareTo(arg1.getPostalCode());
    144145                break;
    145146            case 3:
    146                 cc= arg0.getStreetName().compareTo(arg1.getStreetName());
     147                cc = arg0.getStreetName().compareTo(arg1.getStreetName());
    147148                break;
    148149            case 4:
    149                 cc=arg0.getHouseNumber().compareTo(arg1.getHouseNumber());
     150                cc = arg0.getHouseNumber().compareTo(arg1.getHouseNumber());
    150151                break;
    151152            default:
     
    160161        }
    161162    }
    162 
    163 
    164163}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java

    r32771 r32970  
    1515    private static final String[] COLUMN_NAMES = new String[]{tr("Type"), tr("Name"), tr("Addresses")};
    1616    private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{String.class, String.class, Integer.class};
    17     /**
    18      * @param addressContainer
    19      */
     17
    2018    public StreetTableModel(AddressEditContainer addressContainer) {
    2119        super(addressContainer);
     
    2422    @Override
    2523    public int getColumnCount() {
    26         // TODO Auto-generated method stub
    2724        return NUMBER_OF_COLUMNS;
    2825    }
     
    107104    static class StreetModelSorter extends ColumnSorter<OSMStreet> {
    108105
    109         public StreetModelSorter(int column, boolean asc) {
     106        StreetModelSorter(int column, boolean asc) {
    110107            super(column, asc);
    111108        }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java

    r32771 r32970  
    1414 * Provides a table model to show unresolved addresses.
    1515 *
    16  * @author Oliver Wieland <oliver.wieland@online.de>
     16 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    1717 *
    1818 */
    19 
    2019public class UnresolvedAddressesTableModel extends AddressEditTableModel {
    2120
    2221    private static final int NUMBER_OF_COLUMNS = 5;
    23     private static final String[] COLUMN_NAMES = new String[] { tr("Street"),
     22    private static final String[] COLUMN_NAMES = new String[] {tr("Street"),
    2423            tr("Number"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Name") };
    2524
     
    3332    private static final long serialVersionUID = 424009321818130586L;
    3433
    35     /**
    36      * @param addressContainer
    37      */
    3834    public UnresolvedAddressesTableModel(AddressEditContainer addressContainer) {
    3935        super(addressContainer);
     
    130126    static class UnresolvedAddressModelSorter extends ColumnSorter<OSMAddress> {
    131127
    132         public UnresolvedAddressModelSorter(int column, boolean asc) {
     128        UnresolvedAddressModelSorter(int column, boolean asc) {
    133129            super(column, asc);
    134130        }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java

    r32770 r32970  
    2626 * accepts a list of addresses or streets and executes the tasks to be done by this action.
    2727 *
    28  * @author Oliver Wieland <oliver.wieland@online.de>
     28 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    2929 */
    30 
    3130@SuppressWarnings("serial")
    3231public abstract class AbstractAddressEditAction extends JosmAction implements IAddressEditContainerListener, ICommandListener {
     
    3635    private String txName;
    3736
    38     /**
    39      * @param name
    40      * @param icon
    41      */
    4237    public AbstractAddressEditAction(String name, String iconName, String tooltip, String toolbar) {
    4338        super(name, iconName, tooltip, null, true, toolbar, true);
     
    4641    }
    4742
    48     /**
    49      * @param name
    50      */
    5143    public AbstractAddressEditAction(String name) {
    5244        this(name, null, "", null);
     
    120112     * Updates 'enabled' state depending on the given address container object.
    121113     * @param container The address container (maybe null).
    122      * @return
    123114     */
    124115    protected abstract void updateEnabledState(AddressEditContainer container);
     
    127118     * Updates 'enabled' state depending on the current selection.
    128119     * @param container The selection event.
    129      * @return
    130120     */
    131121    protected abstract void updateEnabledState(AddressEditSelectionEvent event);
     
    133123    /**
    134124     * Redirected action handler for doing actions on a address selection.
    135      * @param ev
     125     * @param ev selection event
    136126     */
    137127    public abstract void addressEditActionPerformed(AddressEditSelectionEvent ev);
     
    139129    /**
    140130     * Redirected action handler for doing actions on an address container.
    141      * @param ev
     131     * @param container address container
    142132     */
    143133    public abstract void addressEditActionPerformed(AddressEditContainer container);
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AddressActions.java

    r32399 r32970  
    33
    44public final class AddressActions {
     5
     6    private AddressActions() {
     7        // Hide default constructor for utilities classes
     8    }
     9
    510    /* Global action objects */
    611    public static SelectAddressesInMapAction getSelectAction() {
    712        return new SelectAddressesInMapAction();
    813    }
     14
    915    public static GuessAddressDataAction getGuessAddressAction() {
    1016        return new GuessAddressDataAction();
    1117    }
     18
    1219    public static ApplyAllGuessesAction getApplyGuessesAction() {
    1320        return new ApplyAllGuessesAction();
    1421    }
     22
    1523    public static RemoveAddressTagsAction getRemoveTagsAction() {
    1624        return new RemoveAddressTagsAction();
    1725    }
     26
    1827    public static AssignAddressToStreetAction getResolveAction() {
    1928        return new AssignAddressToStreetAction();
    2029    }
     30
    2131    public static ConvertToRelationAction getConvertToRelationAction() {
    2232        return new ConvertToRelationAction();
    2333    }
     34
    2435    public static ConvertAllToRelationAction getConvertAllToRelationAction() {
    2536        return new ConvertAllToRelationAction();
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java

    r30737 r32970  
    2121/**
    2222 * Applies the guessed values for a set of addresses.
    23  * @author Oliver Wieland <oliver.wieland@online.de>
     23 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    2424 *
    2525 */
    2626@SuppressWarnings("serial")
    27 public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener{
     27public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener {
    2828    private String tag;
    2929    /**
     
    102102    @Override
    103103    public void mouseClicked(MouseEvent e) {
    104         JTable table = (JTable)e.getSource();
     104        JTable table = (JTable) e.getSource();
    105105        Point p = e.getPoint();
    106         if(e.getClickCount() == 2) {
     106        if (e.getClickCount() == 2) {
    107107            AddressEditTableModel model = (AddressEditTableModel) table.getModel();
    108108            if (model != null) {
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java

    r30348 r32970  
    1212 * Assigns one or more selected addresses to a street, i. e. the name of the street is
    1313 * used as value for the addr:street tag.
    14  * @author Oliver Wieland <oliver.wieland@online.de>
    15  *
     14 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    1615 */
    17 public class AssignAddressToStreetAction extends AbstractAddressEditAction  {
     16public class AssignAddressToStreetAction extends AbstractAddressEditAction {
    1817
    1918    /**
     
    6261        // we only accept a selection: nothing to do here
    6362    }
    64 
    65 
    6663}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertToRelationAction.java

    r30348 r32970  
    1111import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
    1212import org.openstreetmap.josm.plugins.fixAddresses.OSMStreet;
    13 import org.openstreetmap.josm.plugins.fixAddresses.TagUtils;
     13import org.openstreetmap.josm.plugins.fixAddresses.TagConstants;
    1414import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
    1515
     
    5656        Relation r = new Relation();
    5757        commands.add(new AddCommand(r));
    58         commands.add(new ChangePropertyCommand(r, TagUtils.NAME_TAG, streetNode.getName()));
    59         commands.add(new ChangePropertyCommand(r, TagUtils.RELATION_TYPE, TagUtils.ASSOCIATEDSTREET_RELATION_TYPE));
     58        commands.add(new ChangePropertyCommand(r, TagConstants.NAME_TAG, streetNode.getName()));
     59        commands.add(new ChangePropertyCommand(r, TagConstants.RELATION_TYPE, TagConstants.ASSOCIATEDSTREET_RELATION_TYPE));
    6060        // add street with role 'street'
    61         r.addMember(new RelationMember(TagUtils.STREET_RELATION_ROLE, streetNode.getOsmObject()));
     61        r.addMember(new RelationMember(TagConstants.STREET_RELATION_ROLE, streetNode.getOsmObject()));
    6262
    6363        // add address members
    6464        for (OSMAddress addrNode : streetNode.getAddresses()) {
    6565            beginObjectTransaction(addrNode);
    66             r.addMember(new RelationMember(TagUtils.HOUSE_RELATION_ROLE, addrNode.getOsmObject()));
     66            r.addMember(new RelationMember(TagConstants.HOUSE_RELATION_ROLE, addrNode.getOsmObject()));
    6767            addrNode.setStreetName(null); // remove street name
    6868            finishObjectTransaction(addrNode);
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java

    r30348 r32970  
    99import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    1010import org.openstreetmap.josm.plugins.fixAddresses.GuessAddressRunnable;
     11import org.openstreetmap.josm.plugins.fixAddresses.IProgressMonitorFinishedListener;
    1112import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress;
    12 import org.openstreetmap.josm.plugins.fixAddresses.IProgressMonitorFinishedListener;
    1313import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent;
    1414
     
    1717 * with city, post code, state,... However, I strongly encourage you to check the result.
    1818 *
    19  * @author Oliver Wieland <oliver.wieland@online.de>
     19 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    2020 */
    2121@SuppressWarnings("serial")
     
    5858    /**
    5959     * Internal method to start several threads guessing tag values for the given list of addresses.
    60      * @param addrNodes
    6160     */
    6261    private void internalGuessAddresses(List<OSMAddress> nodes) {
    63         if (nodes == null) return;
     62        if (nodes == null)
     63            return;
    6464
    6565        // Launch address guessing thread
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java

    r32445 r32970  
    1515/**
    1616 *
    17  * @author Oliver Wieland <oliver.wieland@online.de>
     17 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    1818 *
    1919 */
     
    5757    /**
    5858     * Internal helper to select the given addresses in the map.
    59      * @param addrToSel
     59     * @param addrToSel addresses
    6060     */
    6161    private void internalSelectAddresses(List<OSMAddress> addrToSel) {
Note: See TracChangeset for help on using the changeset viewer.