Changeset 32970 in osm for applications/editors/josm/plugins/FixAddresses/src
- Timestamp:
- 2016-09-10T17:31:55+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses
- Files:
-
- 1 added
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java
r32771 r32970 40 40 * {@see AddressEditTableModel} 41 41 * 42 * @author Oliver Wieland <oliver.wieland@online.de>42 * @author Oliver Wieland <oliver.wieland@online.de> 43 43 * 44 44 */ … … 96 96 /** 97 97 * Adds a change listener. 98 * @param listener 98 * @param listener change listener 99 99 */ 100 100 public void addChangedListener(IAddressEditContainerListener listener) { … … 104 104 /** 105 105 * Removes a change listener. 106 * @param listener 106 * @param listener change listener 107 107 */ 108 108 public void removeChangedListener(IAddressEditContainerListener listener) { … … 305 305 306 306 /** 307 * Gets the dictionary contain sthe collected streets.308 * @return 307 * Gets the dictionary containing the collected streets. 308 * @return dictionary containing the collected streets 309 309 */ 310 310 public HashMap<String, OSMStreet> getStreetDict() { … … 343 343 /** 344 344 * Gets all addresses without valid street. 345 * @return 345 * @return all addresses without valid street 346 346 */ 347 347 public List<OSMAddress> getUnresolvedItems() { … … 351 351 /** 352 352 * Gets the tags used in the data layer. 353 * @return 353 * @return the tags used in the data layer 354 354 */ 355 355 public HashSet<String> getTags() { … … 366 366 /** 367 367 * Gets the number of streets in the container. 368 * @return 368 * @return the number of streets in the container 369 369 */ 370 370 public int getNumberOfStreets() { … … 374 374 /** 375 375 * Get the number of incomplete addresses. 376 * @return 376 * @return the number of incomplete addresses 377 377 */ 378 378 public int getNumberOfIncompleteAddresses() { … … 382 382 /** 383 383 * Gets the number of unresolved addresses. 384 * @return 384 * @return the number of unresolved addresses 385 385 */ 386 386 public int getNumberOfUnresolvedAddresses() { … … 399 399 /** 400 400 * Gets the number of guessed tags. 401 * @return 401 * @return the number of guessed tags 402 402 */ 403 403 public int getNumberOfGuesses() { … … 414 414 /** 415 415 * Gets all (incomplete and/or unresolved) address nodes to fix. 416 * @return 416 * @return all (incomplete and/or unresolved) address nodes to fix 417 417 */ 418 418 public List<OSMAddress> getAllAddressesToFix() { … … 444 444 /** 445 445 * Tries to assign an address to a street. 446 * @param aNode 446 * @param aNode address 447 447 */ 448 448 private boolean assignAddressToStreet(OSMAddress aNode) { … … 716 716 * @param score Score of the street (length of longest common substring) 717 717 */ 718 publicStreetScore(String name, int score) {718 StreetScore(String name, int score) { 719 719 super(); 720 720 this.name = name; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressProblem.java
r30737 r32970 99 99 @Override 100 100 public void removeSolution(ISolution solution) { 101 if (solutions == null 101 if (solutions == null) throw new RuntimeException("Solution list is null"); 102 102 if (solutions.size() == 0) throw new RuntimeException("Solution list is empty"); 103 103 … … 110 110 return source; 111 111 } 112 113 112 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java
r32771 r32970 13 13 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 14 14 15 public class FixAddressesPreferences extends DefaultTabPreferenceSetting {15 public final class FixAddressesPreferences extends DefaultTabPreferenceSetting { 16 16 private static final String FIX_ADDRESSES_IGNORE_POST_CODE_KEY = "fixAddresses.ignorePostCode"; 17 17 private static final String FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY = "fixAddresses.selectGuessedObjects"; 18 18 19 19 private JCheckBox cbSelectGuessedObjects = new JCheckBox(tr("Include objects used for guesses")); 20 20 private JCheckBox cbIgnorePostCode = new JCheckBox(); … … 22 22 /** 23 23 * Internal factory class. Call <code>FixAddressesPreferences.Factory().createPreferenceSetting()</code> to 24 * create the preference setting instance. 24 * create the preference setting instance. 25 25 */ 26 26 public static class Factory implements PreferenceSettingFactory { … … 30 30 } 31 31 } 32 32 33 33 /** 34 34 * Internal constructor. … … 37 37 loadFromPrefs(); 38 38 } 39 39 40 40 /** 41 41 * Loads the (initial) preference settings. … … 45 45 setIgnorePostCode(Main.pref.getBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, false)); 46 46 } 47 47 48 48 /** 49 49 * Save the preference settings. … … 92 92 * Checks if invalid post codes should be ignored. If yes, post codes are neither 93 93 * checked for existence nor for correctness. 94 * @return 94 * @return {@code true} if invalid post codes should be ignored 95 95 */ 96 96 public boolean isIgnorePostCode() { -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java
r32771 r32970 19 19 * instance of {@link AddressEditDialog}. 20 20 * 21 * @author Oliver Wieland <oliver.wieland@online.de>21 * @author Oliver Wieland <oliver.wieland@online.de> 22 22 */ 23 23 @SuppressWarnings("serial") … … 76 76 for (String tag : addrVisitor.getTags()) { 77 77 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 90 88 } 91 89 … … 102 100 String values = value.toUpperCase().replaceAll(":", "_"); 103 101 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)); 106 103 } 107 104 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessAddressRunnable.java
r32771 r32970 29 29 private boolean canceled; 30 30 31 private GuessedValueHandler[] wayGuessers = new GuessedValueHandler[]{new GuessStreetValueHandler(Tag Utils.ADDR_STREET_TAG)};31 private GuessedValueHandler[] wayGuessers = new GuessedValueHandler[]{new GuessStreetValueHandler(TagConstants.ADDR_STREET_TAG)}; 32 32 private GuessedValueHandler[] nodeGuessers = new GuessedValueHandler[]{ 33 new GuessedValueHandler(Tag Utils.ADDR_POSTCODE_TAG, 500.0),34 new GuessedValueHandler(Tag Utils.ADDR_CITY_TAG, 5000.0),35 new GuessedValueHandler(Tag Utils.ADDR_STATE_TAG, 5000.0),36 new GuessedValueHandler(Tag Utils.ADDR_COUNTRY_TAG, 5000.0),37 new GuessedValueHandler(Tag Utils.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) 38 38 }; 39 39 … … 69 69 return addressesToGuess; 70 70 } 71 71 72 /** 72 73 * @return the isRunning … … 194 195 } 195 196 196 // TODO: Put in separate file197 197 private static class GuessStreetValueHandler extends GuessedValueHandler { 198 publicGuessStreetValueHandler(String tag) {198 GuessStreetValueHandler(String tag) { 199 199 this(tag, null); 200 200 } 201 201 202 publicGuessStreetValueHandler(String tag, OSMAddress aNode) {202 GuessStreetValueHandler(String tag, OSMAddress aNode) { 203 203 super(tag, aNode, 200.0); 204 204 } … … 222 222 currentValue = newVal; 223 223 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));227 224 } 228 225 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/GuessedValueHandler.java
r30348 r32970 36 36 this(tag, null, DEFAULT_MAX_DIST); 37 37 } 38 38 39 39 /** 40 40 * Instantiates a new guessed value handler without node. … … 46 46 this(tag, null, maxDist); 47 47 } 48 48 49 49 /** 50 50 * Instantiates a new guessed value handler. … … 75 75 maxDist = 1.0; 76 76 } 77 77 78 78 this.tag = tag; 79 79 this.maxDist = maxDist; 80 setAddressNode(aNode); 80 setAddressNode(aNode); 81 81 } 82 82 … … 89 89 return aNode; 90 90 } 91 91 92 92 93 93 /** 94 94 * Sets the address node to make the guess for. 95 * @param aNode 95 * @param aNode address node 96 96 */ 97 public void setAddressNode(OSMAddress aNode) { 97 public void setAddressNode(OSMAddress aNode) { 98 98 this.aNode = aNode; 99 99 // reset search results 100 100 minDist = Double.MAX_VALUE; 101 101 srcNode = null; 102 currentValue = null; 102 currentValue = null; 103 103 } 104 104 … … 140 140 return currentValue; 141 141 } 142 143 142 143 144 144 /** 145 145 * Gets the node/way which has been selected for the guess. … … 162 162 public void visit(Node n) { 163 163 assert aNode != null; 164 164 165 165 if (n.hasKey(tag)) { 166 166 double dist = n.getCoor().greatCircleDistance(aNode.getCoor()); … … 176 176 public void visit(Way w) { 177 177 assert aNode != null; 178 178 179 179 if (w.hasKey(tag)) { 180 180 double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java
r30348 r32970 5 5 /** 6 6 * Notifies clients that the container has been changed. 7 * @param container 7 * @param container container 8 8 */ 9 publicvoid containerChanged(AddressEditContainer container);9 void containerChanged(AddressEditContainer container); 10 10 11 11 /** 12 12 * Notifies clients that an entity has been changed. 13 13 */ 14 publicvoid entityChanged(IOSMEntity node);14 void entityChanged(IOSMEntity node); 15 15 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAllKnowingTrashHeap.java
r30348 r32970 13 13 * @return the closest street names 14 14 */ 15 publicList<String> getClosestStreetNames(String name, int maxEntries);15 List<String> getClosestStreetNames(String name, int maxEntries); 16 16 17 17 /** … … 21 21 * @return the closest street name 22 22 */ 23 publicString getClosestStreetName(String name);23 String getClosestStreetName(String name); 24 24 25 25 /** … … 29 29 * @return true, if street name is valid; otherwise false. 30 30 */ 31 publicboolean isValidStreetName(String name);31 boolean isValidStreetName(String name); 32 32 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java
r30348 r32970 11 11 * @param command The command instance to process by the enclosing command listener. 12 12 */ 13 publicvoid commandIssued(IOSMEntity entity, Command command);13 void commandIssued(IOSMEntity entity, Command command); 14 14 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java
r32771 r32970 10 10 * Base interface for all node entities. A node entity is a lightweight wrapper 11 11 * 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 <oliver.wieland@online.de> 14 13 */ 15 14 public interface IOSMEntity extends Comparable<IOSMEntity> { 16 15 /** 17 16 * Gets the underlying OSM object. 18 * @return 17 * @return the underlying OSM object 19 18 */ 20 publicOsmPrimitive getOsmObject();19 OsmPrimitive getOsmObject(); 21 20 22 21 /** 23 22 * Checks if underlying OSM object has a name. 24 * @return 23 * @return {@code true} if underlying OSM object has a name 25 24 */ 26 publicboolean hasName();25 boolean hasName(); 27 26 28 27 /** 29 28 * Gets the name of the entity node. 30 * @return 29 * @return the name of the entity node 31 30 */ 32 publicString getName();31 String getName(); 33 32 34 33 /** 35 34 * Gets the children of the entity node. 36 * @return 35 * @return the children of the entity node 37 36 */ 38 publicList<IOSMEntity> getChildren();37 List<IOSMEntity> getChildren(); 39 38 40 39 /** … … 42 41 * node, it just returns the node coordinate. For ways and areas, this 43 42 * method returns the coordinate of the center (balance point). 44 * @return 43 * @return the coordinate of the node 45 44 */ 46 publicLatLon getCoor();45 LatLon getCoor(); 47 46 48 47 /** 49 48 * Adds a command listener. 50 * @param listener 49 * @param listener command listener 51 50 */ 52 publicvoid addCommandListener(ICommandListener listener);51 void addCommandListener(ICommandListener listener); 53 52 54 53 /** 55 54 * Removes a command listener. 56 * @param listener 55 * @param listener command listener 57 56 */ 58 publicvoid removeCommandListener(ICommandListener listener);57 void removeCommandListener(ICommandListener listener); 59 58 60 59 /** … … 64 63 * @param visitor the problem visitor 65 64 */ 66 publicvoid visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor);65 void visit(IAllKnowingTrashHeap trashHeap, IProblemVisitor visitor); 67 66 68 67 @Override -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblem.java
r30348 r32970 11 11 * @return the source 12 12 */ 13 publicIOSMEntity getSource();13 IOSMEntity getSource(); 14 14 15 15 /** … … 18 18 * @return the description 19 19 */ 20 publicString getDescription();20 String getDescription(); 21 21 22 22 /** … … 25 25 * @return the type 26 26 */ 27 publicProblemType getType();27 ProblemType getType(); 28 28 29 29 /** … … 32 32 * @return the solutions 33 33 */ 34 publicList<ISolution> getSolutions();34 List<ISolution> getSolutions(); 35 35 36 36 /** … … 39 39 * @param solution the solution 40 40 */ 41 publicvoid addSolution(ISolution solution);41 void addSolution(ISolution solution); 42 42 43 43 /** … … 46 46 * @param solution the solution 47 47 */ 48 publicvoid removeSolution(ISolution solution);48 void removeSolution(ISolution solution); 49 49 50 50 /** 51 51 * Removes all solutions from this problem. 52 52 */ 53 publicvoid clearSolutions();53 void clearSolutions(); 54 54 55 55 /** … … 58 58 * @param solution the solution 59 59 */ 60 publicvoid applySolution(ISolution solution);60 void applySolution(ISolution solution); 61 61 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProblemVisitor.java
r30348 r32970 8 8 * @param problem the problem to add 9 9 */ 10 publicvoid addProblem(IProblem problem);10 void addProblem(IProblem problem); 11 11 12 12 /** 13 13 * Removes the problems of the given source. 14 14 */ 15 publicvoid removeProblemsOfSource(IOSMEntity entity);15 void removeProblemsOfSource(IOSMEntity entity); 16 16 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IProgressMonitorFinishedListener.java
r30348 r32970 3 3 4 4 public interface IProgressMonitorFinishedListener { 5 publicvoid finished();5 void finished(); 6 6 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ISolution.java
r30348 r32970 11 11 * @return the description 12 12 */ 13 publicString getDescription();13 String getDescription(); 14 14 15 15 /** … … 18 18 * @return the action 19 19 */ 20 publicJosmAction getAction();20 JosmAction getAction(); 21 21 22 22 /** … … 25 25 * @return the type 26 26 */ 27 publicSolutionType getType();27 SolutionType getType(); 28 28 29 29 /** 30 30 * Executes one or more actions to solve a problem. 31 31 */ 32 publicvoid solve();32 void solve(); 33 33 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMAddress.java
r30737 r32970 34 34 35 35 public OSMAddress(OsmPrimitive osmObject) { 36 super(osmObject);36 super(osmObject); 37 37 } 38 38 39 39 @Override 40 40 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); 46 45 } 47 46 … … 50 49 * describe an address. 51 50 * 52 * @return 51 * @return {@code true} if the underlying address node has all tags usually needed to describe an address 53 52 */ 54 53 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; 70 68 } 71 69 … … 73 71 * Gets the name of the street associated with this address. 74 72 * 75 * @return 73 * @return the name of the street associated with this address 76 74 */ 77 75 public String getStreetName() { 78 return getTagValueWithGuess(TagUtils.ADDR_STREET_TAG);76 return getTagValueWithGuess(TagConstants.ADDR_STREET_TAG); 79 77 } 80 78 … … 89 87 */ 90 88 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)) 104 90 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 } 113 111 } 114 112 … … 116 114 * Returns <tt>true</tt>, if this address node has a street name. 117 115 * 118 * @return 116 * @return <tt>true</tt>, if this address node has a street name 119 117 */ 120 118 public boolean hasStreetName() { 121 return hasTag(TagUtils.ADDR_STREET_TAG) || isPartOfRelation();119 return hasTag(TagConstants.ADDR_STREET_TAG) || isPartOfRelation(); 122 120 } 123 121 … … 128 126 */ 129 127 public String getGuessedStreetName() { 130 return getGuessedValue(TagUtils.ADDR_STREET_TAG);128 return getGuessedValue(TagConstants.ADDR_STREET_TAG); 131 129 } 132 130 … … 139 137 * the source object of the guess. 140 138 */ 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); 144 141 } 145 142 … … 150 147 */ 151 148 public boolean hasGuessedStreetName() { 152 return hasGuessedValue(TagUtils.ADDR_STREET_TAG);149 return hasGuessedValue(TagConstants.ADDR_STREET_TAG); 153 150 } 154 151 … … 157 154 */ 158 155 public String getGuessedPostalCode() { 159 return getGuessedValue(TagUtils.ADDR_POSTCODE_TAG);156 return getGuessedValue(TagConstants.ADDR_POSTCODE_TAG); 160 157 } 161 158 … … 169 166 */ 170 167 public void setGuessedPostalCode(String guessedPostCode, OsmPrimitive srcObj) { 171 setGuessedValue(TagUtils.ADDR_POSTCODE_TAG, guessedPostCode, srcObj);168 setGuessedValue(TagConstants.ADDR_POSTCODE_TAG, guessedPostCode, srcObj); 172 169 } 173 170 … … 178 175 */ 179 176 public boolean hasGuessedPostalCode() { 180 return hasGuessedValue(TagUtils.ADDR_POSTCODE_TAG);177 return hasGuessedValue(TagConstants.ADDR_POSTCODE_TAG); 181 178 } 182 179 … … 185 182 */ 186 183 public String getGuessedCity() { 187 return getGuessedValue(TagUtils.ADDR_CITY_TAG);184 return getGuessedValue(TagConstants.ADDR_CITY_TAG); 188 185 } 189 186 … … 197 194 */ 198 195 public void setGuessedCity(String guessedCity, OsmPrimitive srcObj) { 199 setGuessedValue(TagUtils.ADDR_CITY_TAG, guessedCity, srcObj);196 setGuessedValue(TagConstants.ADDR_CITY_TAG, guessedCity, srcObj); 200 197 } 201 198 … … 206 203 */ 207 204 public boolean hasGuessedCity() { 208 return hasGuessedValue(TagUtils.ADDR_CITY_TAG);205 return hasGuessedValue(TagConstants.ADDR_CITY_TAG); 209 206 } 210 207 … … 212 209 * Returns true, if this instance has guesses regarding address tags. 213 210 * 214 * @return 211 * @return true, if this instance has guesses regarding address tags 215 212 */ 216 213 public boolean hasGuesses() { 217 return guessedValues.size() > 0;214 return guessedValues.size() > 0; 218 215 } 219 216 … … 222 219 */ 223 220 public void applyAllGuesses() { 224 for (String tag : guessedValues.keySet()) {225 applyGuessForTag(tag);226 }227 228 // Clear all guesses229 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(); 231 228 } 232 229 … … 238 235 */ 239 236 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 } 246 243 } 247 244 … … 249 246 * Gets the name of the post code associated with this address. 250 247 * 251 * @return 248 * @return the name of the post code associated with this address 252 249 */ 253 250 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; 261 258 } 262 259 … … 267 264 */ 268 265 public boolean hasValidPostalCode() { 269 return PostalCodeChecker.hasValidPostalCode(this);266 return PostalCodeChecker.hasValidPostalCode(this); 270 267 } 271 268 … … 276 273 */ 277 274 public boolean hasPostalCode() { 278 return hasTag(TagUtils.ADDR_POSTCODE_TAG);275 return hasTag(TagConstants.ADDR_POSTCODE_TAG); 279 276 } 280 277 … … 282 279 * Gets the name of the house number associated with this address. 283 280 * 284 * @return 281 * @return the name of the house number associated with this address 285 282 */ 286 283 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); 295 292 } 296 293 … … 301 298 */ 302 299 public boolean hasHouseNumber() { 303 return TagUtils.hasAddrHousenumberTag(osmObject) 304 || isPartOfInterpolation; 300 return TagUtils.hasAddrHousenumberTag(osmObject) || isPartOfInterpolation; 305 301 } 306 302 307 303 @Override 308 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 ""; 315 311 } 316 312 … … 321 317 */ 322 318 protected boolean isPartOfInterpolation() { 323 return isPartOfInterpolation;319 return isPartOfInterpolation; 324 320 } 325 321 … … 330 326 */ 331 327 protected boolean isPartOfRelation() { 332 return isPartOfAssocStreetRel;328 return isPartOfAssocStreetRel; 333 329 } 334 330 … … 336 332 * Gets the name of the city associated with this address. 337 333 * 338 * @return 334 * @return the name of the city associated with this address 339 335 */ 340 336 public String getCity() { 341 return getTagValueWithGuess(TagUtils.ADDR_CITY_TAG);337 return getTagValueWithGuess(TagConstants.ADDR_CITY_TAG); 342 338 } 343 339 … … 348 344 */ 349 345 public boolean hasCity() { 350 return hasTag(TagUtils.ADDR_CITY_TAG);346 return hasTag(TagConstants.ADDR_CITY_TAG); 351 347 } 352 348 … … 354 350 * Gets the name of the state associated with this address. 355 351 * 356 * @return 352 * @return the name of the state associated with this address 357 353 */ 358 354 public String getState() { 359 return getTagValueWithGuess(TagUtils.ADDR_STATE_TAG);355 return getTagValueWithGuess(TagConstants.ADDR_STATE_TAG); 360 356 } 361 357 … … 366 362 */ 367 363 public boolean hasState() { 368 return hasTag(TagUtils.ADDR_STATE_TAG);364 return hasTag(TagConstants.ADDR_STATE_TAG); 369 365 } 370 366 … … 372 368 * Gets the name of the country associated with this address. 373 369 * 374 * @return 370 * @return the name of the country associated with this address 375 371 */ 376 372 public String getCountry() { 377 return getTagValueWithGuess(TagUtils.ADDR_COUNTRY_TAG);373 return getTagValueWithGuess(TagConstants.ADDR_COUNTRY_TAG); 378 374 } 379 375 … … 384 380 */ 385 381 public boolean hasCountry() { 386 return hasTag(TagUtils.ADDR_COUNTRY_TAG);382 return hasTag(TagConstants.ADDR_COUNTRY_TAG); 387 383 } 388 384 … … 391 387 */ 392 388 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); 399 395 } 400 396 … … 469 465 * Applies the street name from the specified street node. 470 466 * 471 * @param node 467 * @param node street node 472 468 */ 473 469 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 } 482 478 } 483 479 … … 490 486 */ 491 487 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); 498 494 } 499 495 … … 506 502 */ 507 503 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; 514 510 } 515 511 … … 521 517 */ 522 518 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(); 527 523 } 528 524 … … 534 530 */ 535 531 public boolean needsGuess() { 536 return needsGuessedValue(Tag Utils.ADDR_CITY_TAG)537 || needsGuessedValue(Tag Utils.ADDR_POSTCODE_TAG)538 || needsGuessedValue(Tag Utils.ADDR_COUNTRY_TAG) ||539 // needsGuessedValue(Tag Utils.ADDR_STATE_TAG) ||540 needsGuessedValue(Tag Utils.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); 541 537 } 542 538 … … 547 543 */ 548 544 public boolean needsGuessedValue(String tag) { 549 return MISSING_TAG.equals(getTagValueWithGuess(tag));545 return MISSING_TAG.equals(getTagValueWithGuess(tag)); 550 546 } 551 547 … … 554 550 */ 555 551 public void clearAllGuesses() { 556 guessedValues.clear();552 guessedValues.clear(); 557 553 } 558 554 … … 603 599 */ 604 600 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)); 609 605 } 610 606 … … 612 608 * Returns true, if this instance has derived values from any referrer. 613 609 * 614 * @return 610 * @return true, if this instance has derived values from any referrer 615 611 */ 616 612 public boolean hasDerivedValues() { 617 return derivedValues.size() > 0;613 return derivedValues.size() > 0; 618 614 } 619 615 … … 623 619 * @param tag 624 620 * The tag to get the derived value for. 625 * @return 621 * @return the derived value for the given tag 626 622 */ 627 623 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); 632 628 } 633 629 … … 641 637 */ 642 638 public void setDerivedValue(String tag, String value) { 643 derivedValues.put(tag, value);639 derivedValues.put(tag, value); 644 640 } 645 641 … … 647 643 * Sets the street name of the address node. 648 644 * 649 * @param streetName 645 * @param streetName street name of the address node 650 646 */ 651 647 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); 656 652 } 657 653 … … 659 655 * Sets the state of the address node. 660 656 * 661 * @param state 657 * @param state state of the address node 662 658 */ 663 659 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); 668 664 } 669 665 … … 671 667 * Sets the country of the address node. 672 668 * 673 * @param country 669 * @param country country of the address node 674 670 */ 675 671 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); 680 676 } 681 677 … … 683 679 * Sets the post code of the address node. 684 680 * 685 * @param postCode 681 * @param postCode post code of the address node 686 682 */ 687 683 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); 692 688 } 693 689 694 690 @Override 695 691 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 } 754 747 } 755 748 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMEntityBase.java
r30737 r32970 33 33 protected OsmPrimitive osmObject; 34 34 35 /**36 * @param osmObject37 */38 35 public OSMEntityBase(OsmPrimitive osmObject) { 39 36 super(); … … 51 48 /** 52 49 * Adds a change listener. 53 * @param listener 50 * @param listener change listener 54 51 */ 55 52 public static void addChangedListener(IAddressEditContainerListener listener) { … … 60 57 /** 61 58 * Removes a change listener. 62 * @param listener 59 * @param listener change listener 63 60 */ 64 61 public static void removeChangedListener(IAddressEditContainerListener listener) { … … 79 76 /** 80 77 * Adds a command listener. 81 * @param listener 82 */ 83 @Override 84 78 * @param listener command listener 79 */ 80 @Override 81 public void addCommandListener(ICommandListener listener) { 85 82 CheckParameterUtil.ensureParameterNotNull(listener, "listener"); 86 83 cmdListeners.add(listener); … … 89 86 /** 90 87 * Removes a command listener. 91 * @param listener 92 */ 93 @Override 94 88 * @param listener command listener 89 */ 90 @Override 91 public void removeCommandListener(ICommandListener listener) { 95 92 CheckParameterUtil.ensureParameterNotNull(listener, "listener"); 96 93 cmdListeners.remove(listener); … … 115 112 116 113 @Override 117 114 public OsmPrimitive getOsmObject() { 118 115 return osmObject; 119 116 } … … 131 128 public String getName() { 132 129 if (TagUtils.hasNameTag(osmObject)) { 133 return 130 return TagUtils.getNameValue(osmObject); 134 131 } 135 132 return ""; … … 202 199 203 200 if (osm instanceof Node) { 204 return ((Node) osm).getCoor();201 return ((Node) osm).getCoor(); 205 202 // way: return center 206 203 } else if (osm instanceof Way) { -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreet.java
r30737 r32970 13 13 * consists at least of one segment. 14 14 * 15 * @author Oliver Wieland <oliver.wieland@online.de>15 * @author Oliver Wieland <oliver.wieland@online.de> 16 16 */ 17 17 public class OSMStreet extends OSMEntityBase { … … 19 19 private List<OSMAddress> addresses; 20 20 21 /**22 * @param osmPrimitive23 */24 21 public OSMStreet(OsmPrimitive osmPrimitive) { 25 22 super(osmPrimitive); … … 27 24 28 25 @Override 29 26 public List<IOSMEntity> getChildren() { 30 27 return children; 31 28 } … … 33 30 /** 34 31 * Adds a street segment to the street node. 35 * @param segment 32 * @param segment street segment 36 33 */ 37 34 public void addStreetSegment(OSMStreetSegment segment) { … … 89 86 /** 90 87 * Gets the number of addresses associated with this street. 91 * @return 88 * @return number of addresses associated with this street 92 89 */ 93 90 public int getNumberOfAddresses() { … … 99 96 /** 100 97 * Gets the number of street segments of this street. 101 * @return 98 * @return number of street segments of this street 102 99 */ 103 100 public int getNumberOfSegments() { … … 116 113 * Gets the road type(s) of this street. If the street has different types, 117 114 * they are separated by comma. 118 * @return 115 * @return road type(s) of this street 119 116 */ 120 117 public String getType() { … … 124 121 OsmPrimitive osmPrim = seg.getOsmObject(); 125 122 if (TagUtils.hasHighwayTag(osmPrim)) { 126 String val = osmPrim.get(Tag Utils.HIGHWAY_TAG);123 String val = osmPrim.get(TagConstants.HIGHWAY_TAG); 127 124 if (!types.contains(val)) { 128 125 types.add(val); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMStreetSegment.java
r30348 r32970 10 10 * sometimes a street is separated into many segments, e. g. due to different speed limits, bridges, etc.. 11 11 * 12 * @author Oliver Wieland <oliver.wieland@online.de>12 * @author Oliver Wieland <oliver.wieland@online.de> 13 13 * 14 14 */ -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmFactory.java
r30737 r32970 7 7 import org.openstreetmap.josm.data.osm.Way; 8 8 9 public class OsmFactory {9 public final class OsmFactory { 10 10 private static HashMap<String, OSMAddress> addressCache = new HashMap<>(); 11 12 private OsmFactory() { 13 // Hide default constructor for utilities classes 14 } 11 15 12 16 /** 13 17 * Creates an address node from an OSM node, if possible. 14 * @param node 15 * @return 18 * @param node OSM node 19 * @return created address 16 20 */ 17 21 public static OSMAddress createNode(Node node) { … … 34 38 /** 35 39 * Creates an node entity from an OSM way, if possible. 36 * @param way 40 * @param way OSM way 37 41 * @return The new node instance or null; if given way is inappropriate. 38 42 */ … … 43 47 44 48 // Check for building with address 45 if (way.isClosed() && TagUtils.hasBuildingTag(way) 49 if (way.isClosed() && TagUtils.hasBuildingTag(way) && TagUtils.isAddress(way)) { 46 50 String aid = "" + way.getId(); 47 51 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OsmUtils.java
r30348 r32970 17 17 import org.openstreetmap.josm.tools.Pair; 18 18 19 // TODO: Auto-generated Javadoc20 19 /** 21 20 * The Class OsmUtils provides some utilities not provided by the OSM data framework. 22 21 */ 23 public class OsmUtils {22 public final class OsmUtils { 24 23 25 24 /** … … 39 38 */ 40 39 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; 42 42 43 43 double minDist = Double.MAX_VALUE; 44 List<Pair<Node, Node>> x = w.getNodePairs(true);44 List<Pair<Node, Node>> x = w.getNodePairs(true); 45 45 46 46 for (Pair<Node, Node> pair : x) { … … 126 126 if (!StringUtils.isNullOrEmpty(streetName)) { 127 127 // street name found -> set property 128 address.setDerivedValue(Tag Utils.ADDR_STREET_TAG, streetName);128 address.setDerivedValue(TagConstants.ADDR_STREET_TAG, streetName); 129 129 hasValuesFromRel = true; 130 130 break; … … 136 136 // Check for other address properties 137 137 if (TagUtils.hasAddrCityTag(r)) { // city 138 address.setDerivedValue(Tag Utils.ADDR_CITY_TAG, TagUtils.getAddrCityValue(r));138 address.setDerivedValue(TagConstants.ADDR_CITY_TAG, TagUtils.getAddrCityValue(r)); 139 139 hasValuesFromRel = true; 140 140 } 141 141 if (TagUtils.hasAddrCountryTag(r)) { // country 142 address.setDerivedValue(Tag Utils.ADDR_COUNTRY_TAG, TagUtils.getAddrCountryValue(r));142 address.setDerivedValue(TagConstants.ADDR_COUNTRY_TAG, TagUtils.getAddrCountryValue(r)); 143 143 hasValuesFromRel = true; 144 144 } 145 145 if (TagUtils.hasAddrPostcodeTag(r)) { // postcode 146 address.setDerivedValue(Tag Utils.ADDR_POSTCODE_TAG, TagUtils.getAddrPostcodeValue(r));146 address.setDerivedValue(TagConstants.ADDR_POSTCODE_TAG, TagUtils.getAddrPostcodeValue(r)); 147 147 hasValuesFromRel = true; 148 148 } … … 167 167 Way w = (Way) osm; 168 168 if (TagUtils.hasAddrInterpolationTag(w)) { 169 applyDerivedValue(address, w, Tag Utils.ADDR_POSTCODE_TAG);170 applyDerivedValue(address, w, Tag Utils.ADDR_CITY_TAG);171 applyDerivedValue(address, w, Tag Utils.ADDR_COUNTRY_TAG);172 applyDerivedValue(address, w, Tag Utils.ADDR_STREET_TAG);173 applyDerivedValue(address, w, Tag Utils.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); 174 174 return true; 175 175 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/PostalCodeChecker.java
r30737 r32970 10 10 * The Class PostcodeChecker. 11 11 */ 12 public class PostalCodeChecker {12 public final class PostalCodeChecker { 13 13 private static HashMap<String, String> postalCodePatternMap = new HashMap<>(); 14 14 15 15 static { 16 16 fillMap(); 17 } 18 19 private PostalCodeChecker() { 20 // Hide default constructor for utilities classes 17 21 } 18 22 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StringUtils.java
r30348 r32970 4 4 import java.util.List; 5 5 6 public class StringUtils { 6 public final class StringUtils { 7 8 private StringUtils() { 9 // Hide default constructor for utilities classes 10 } 11 7 12 /** 8 13 * Checks, if a string is either null or empty. … … 59 64 /* 60 65 * 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)) { 62 68 l[i][j] = 1 + l[i + 1][j + 1]; 63 69 } else { … … 74 80 * @param a The first string. 75 81 * @param b The second string. 76 * @return 82 * @return the longest common substring of a and b 77 83 */ 78 84 public static String getLongestCommonSubstring(String a, String b) { … … 102 108 } 103 109 104 l = null;105 110 return sb.toString(); 106 111 } … … 126 131 for (String curString : haystack) { 127 132 int ll = lcsLength(needle, curString); 128 double ratio = ll / (double) lNeedle;133 double ratio = ll / (double) lNeedle; 129 134 if (ratio > maxRatio) { 130 135 maxRatio = ratio; 131 136 bestMatch = curString; 132 137 } 133 134 138 } 135 139 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/TagUtils.java
r30348 r32970 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.plugins.fixAddresses; 3 4 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ACCESS_TAG; 5 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_CITY_TAG; 6 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_COUNTRY_TAG; 7 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_HOUSENAME_TAG; 8 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_HOUSENUMBER_TAG; 9 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_INCLUSION_TAG; 10 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_INTERPOLATION_TAG; 11 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_POSTCODE_TAG; 12 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_STATE_TAG; 13 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADDR_STREET_TAG; 14 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ADMIN_LEVEL_TAG; 15 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.AGRICULTURAL_TAG; 16 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.AMENITY_TAG; 17 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.AREA_TAG; 18 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ASSOCIATEDSTREET_RELATION_TYPE; 19 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BARRIER_TAG; 20 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BICYCLE_TAG; 21 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BOUNDARY_TAG; 22 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BRIDGE_TAG; 23 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BUILDING_LEVELS_TAG; 24 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.BUILDING_TAG; 25 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CABLES_TAG; 26 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CAPACITY_DISABLED_TAG; 27 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CAPACITY_TAG; 28 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.COMMENT_TAG; 29 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CONSTRUCTION_TAG; 30 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.COUNTRIES_REQUIRE_STATE; 31 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CRAFT_TAG; 32 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CUISINE_TAG; 33 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.CUTTING_TAG; 34 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.DENOMINATION_TAG; 35 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ELECTRIFIED_TAG; 36 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.EMBANKMENT_TAG; 37 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FIREPLACE_TAG; 38 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FIXME_TAG; 39 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FOOT_TAG; 40 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.FREQUENCY_TAG; 41 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.GOODS_TAG; 42 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.HGV_TAG; 43 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.HIGHWAY_TAG; 44 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.HORSE_TAG; 45 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.INT_REF_TAG; 46 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.JUNCTION_TAG; 47 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LANDUSE_TAG; 48 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LANES_TAG; 49 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LAYER_TAG; 50 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LEISURE_TAG; 51 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LIT_TAG; 52 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.LOC_REF_TAG; 53 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MAN_MADE_TAG; 54 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MAXSPEED_TAG; 55 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MOTORCAR_TAG; 56 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MOTORCYCLE_TAG; 57 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.MOTOR_VEHICLE_TAG; 58 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NAME_DE_TAG; 59 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NAME_TAG; 60 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NATURAL_TAG; 61 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NAT_REF_TAG; 62 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NOEXIT_TAG; 63 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NOTE_DE_TAG; 64 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.NOTE_TAG; 65 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ONEWAY_TAG; 66 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.OPENING_HOURS_TAG; 67 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.OPERATOR_TAG; 68 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.PARKING_TAG; 69 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.POWER_TAG; 70 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.RAILWAY_TAG; 71 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.REF_TAG; 72 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.RELATION_TYPE; 73 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.RELIGION_TAG; 74 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.ROUTE_TAG; 75 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SAC_SCALE_TAG; 76 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SEGREGATED_TAG; 77 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SERVICE_TAG; 78 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SHOP_TAG; 79 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SMOOTHNESS_TAG; 80 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SOURCE_TAG; 81 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SPORT_TAG; 82 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.STREET_RELATION_ROLE; 83 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.SURFACE_TAG; 84 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TOURISM_TAG; 85 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TRACKTYPE_TAG; 86 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TRAIL_VISIBILITY_TAG; 87 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TUNNEL_TAG; 88 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.TYPE_TAG; 89 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.VEHICLE_TAG; 90 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.VOLTAGE_TAG; 91 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WATERWAY_TAG; 92 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WHEELCHAIR_TAG; 93 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WHITEWATER_SECTION_GRADE_TAG; 94 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WHITEWATER_TAG; 95 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WIDTH_TAG; 96 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WIRES_TAG; 97 import static org.openstreetmap.josm.plugins.fixAddresses.TagConstants.WOOD_TAG; 3 98 4 99 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 7 102 import org.openstreetmap.josm.data.osm.Way; 8 103 104 // CHECKSTYLE.OFF: MethodCountCheck 105 9 106 /** 10 107 * Contains the tags used within OSM. FIXME: Maybe there is a class or similar 11 108 * within JOSM which already defines them, but I have not found it so far. 12 109 * 13 * @author Oliver Wieland <oliver.wieland@online.de> 14 * 110 * @author Oliver Wieland <oliver.wieland@online.de> 15 111 */ 16 112 public 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 } 21 117 22 118 /** 23 119 * Checks if the given OSM object has a (non-empty) value for the given tag. 24 *25 120 * @param osm the osm object to inspect. 26 121 * @param tag the tag to look for. … … 33 128 /** 34 129 * 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 36 131 */ 37 132 public static boolean isAddress(OsmPrimitive osmObject) { 38 return 39 40 133 return TagUtils.hasAddrCityTag(osmObject) || TagUtils.hasAddrCountryTag(osmObject) || 134 TagUtils.hasAddrHousenumberTag(osmObject) || TagUtils.hasAddrPostcodeTag(osmObject) || 135 TagUtils.hasAddrStateTag(osmObject) || TagUtils.hasAddrStreetTag(osmObject); 41 136 } 42 137 43 138 /** 44 139 * 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. 48 141 */ 49 142 public static boolean hasParkingTag(OsmPrimitive osmPrimitive) { … … 53 146 /** 54 147 * Gets the value of tag 'parking'. 55 * 56 * @param osmPrimitive 57 * The OSM entity to check. 148 * @param osmPrimitive The OSM entity to check. 58 149 */ 59 150 public static String getParkingValue(OsmPrimitive osmPrimitive) { … … 63 154 /** 64 155 * 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. 68 157 */ 69 158 public static boolean hasShopTag(OsmPrimitive osmPrimitive) { … … 73 162 /** 74 163 * Gets the value of tag 'shop'. 75 * 76 * @param osmPrimitive 77 * The OSM entity to check. 164 * @param osmPrimitive The OSM entity to check. 78 165 */ 79 166 public static String getShopValue(OsmPrimitive osmPrimitive) { … … 83 170 /** 84 171 * 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. 88 173 */ 89 174 public static boolean hasCraftTag(OsmPrimitive osmPrimitive) { … … 93 178 /** 94 179 * Gets the value of tag 'craft'. 95 * 96 * @param osmPrimitive 97 * The OSM entity to check. 180 * @param osmPrimitive The OSM entity to check. 98 181 */ 99 182 public static String getCraftValue(OsmPrimitive osmPrimitive) { … … 103 186 /** 104 187 * 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. 108 189 */ 109 190 public static boolean hasSurfaceTag(OsmPrimitive osmPrimitive) { … … 113 194 /** 114 195 * Gets the value of tag 'surface'. 115 * 116 * @param osmPrimitive 117 * The OSM entity to check. 196 * @param osmPrimitive The OSM entity to check. 118 197 */ 119 198 public static String getSurfaceValue(OsmPrimitive osmPrimitive) { … … 123 202 /** 124 203 * 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. 128 205 */ 129 206 public static boolean hasCuisineTag(OsmPrimitive osmPrimitive) { … … 133 210 /** 134 211 * Gets the value of tag 'cuisine'. 135 * 136 * @param osmPrimitive 137 * The OSM entity to check. 212 * @param osmPrimitive The OSM entity to check. 138 213 */ 139 214 public static String getCuisineValue(OsmPrimitive osmPrimitive) { … … 143 218 /** 144 219 * 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. 148 221 */ 149 222 public static boolean hasWoodTag(OsmPrimitive osmPrimitive) { … … 153 226 /** 154 227 * Gets the value of tag 'wood'. 155 * 156 * @param osmPrimitive 157 * The OSM entity to check. 228 * @param osmPrimitive The OSM entity to check. 158 229 */ 159 230 public static String getWoodValue(OsmPrimitive osmPrimitive) { … … 163 234 /** 164 235 * 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. 168 237 */ 169 238 public static boolean hasFootTag(OsmPrimitive osmPrimitive) { … … 173 242 /** 174 243 * Gets the value of tag 'foot'. 175 * 176 * @param osmPrimitive 177 * The OSM entity to check. 244 * @param osmPrimitive The OSM entity to check. 178 245 */ 179 246 public static String getFootValue(OsmPrimitive osmPrimitive) { … … 183 250 /** 184 251 * 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. 188 253 */ 189 254 public static boolean hasNameDeTag(OsmPrimitive osmPrimitive) { … … 193 258 /** 194 259 * 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. 198 261 */ 199 262 public static String getNameDeValue(OsmPrimitive osmPrimitive) { … … 203 266 /** 204 267 * 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. 208 269 */ 209 270 public static boolean hasNatRefTag(OsmPrimitive osmPrimitive) { … … 213 274 /** 214 275 * 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. 218 277 */ 219 278 public static String getNatRefValue(OsmPrimitive osmPrimitive) { … … 223 282 /** 224 283 * 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. 228 285 */ 229 286 public static boolean hasNoteDeTag(OsmPrimitive osmPrimitive) { … … 233 290 /** 234 291 * 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. 238 293 */ 239 294 public static String getNoteDeValue(OsmPrimitive osmPrimitive) { … … 243 298 /** 244 299 * 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. 248 301 */ 249 302 public static boolean hasAddrStreetTag(OsmPrimitive osmPrimitive) { … … 254 307 /** 255 308 * 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. 259 310 */ 260 311 public static String getAddrStreetValue(OsmPrimitive osmPrimitive) { … … 264 315 /** 265 316 * 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. 269 318 */ 270 319 public static boolean hasTypeTag(OsmPrimitive osmPrimitive) { … … 274 323 /** 275 324 * Gets the value of tag 'type'. 276 * 277 * @param osmPrimitive 278 * The OSM entity to check. 325 * @param osmPrimitive The OSM entity to check. 279 326 */ 280 327 public static String getTypeValue(OsmPrimitive osmPrimitive) { … … 284 331 /** 285 332 * 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. 289 334 */ 290 335 public static boolean hasAddrCityTag(OsmPrimitive osmPrimitive) { … … 295 340 /** 296 341 * 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. 300 343 */ 301 344 public static String getAddrCityValue(OsmPrimitive osmPrimitive) { … … 305 348 /** 306 349 * 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. 310 351 */ 311 352 public static boolean hasBoundaryTag(OsmPrimitive osmPrimitive) { … … 315 356 /** 316 357 * Gets the value of tag 'boundary'. 317 * 318 * @param osmPrimitive 319 * The OSM entity to check. 358 * @param osmPrimitive The OSM entity to check. 320 359 */ 321 360 public static String getBoundaryValue(OsmPrimitive osmPrimitive) { … … 325 364 /** 326 365 * 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. 330 367 */ 331 368 public static boolean hasSmoothnessTag(OsmPrimitive osmPrimitive) { … … 336 373 /** 337 374 * Gets the value of tag 'smoothness'. 338 * 339 * @param osmPrimitive 340 * The OSM entity to check. 375 * @param osmPrimitive The OSM entity to check. 341 376 */ 342 377 public static String getSmoothnessValue(OsmPrimitive osmPrimitive) { … … 346 381 /** 347 382 * 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. 351 384 */ 352 385 public static boolean hasOpeningHoursTag(OsmPrimitive osmPrimitive) { … … 357 390 /** 358 391 * 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. 362 393 */ 363 394 public static String getOpeningHoursValue(OsmPrimitive osmPrimitive) { … … 368 399 /** 369 400 * 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. 373 402 */ 374 403 public static boolean hasBicycleTag(OsmPrimitive osmPrimitive) { … … 378 407 /** 379 408 * Gets the value of tag 'bicycle'. 380 * 381 * @param osmPrimitive 382 * The OSM entity to check. 409 * @param osmPrimitive The OSM entity to check. 383 410 */ 384 411 public static String getBicycleValue(OsmPrimitive osmPrimitive) { … … 388 415 /** 389 416 * 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. 393 418 */ 394 419 public static boolean hasReligionTag(OsmPrimitive osmPrimitive) { … … 398 423 /** 399 424 * Gets the value of tag 'religion'. 400 * 401 * @param osmPrimitive 402 * The OSM entity to check. 425 * @param osmPrimitive The OSM entity to check. 403 426 */ 404 427 public static String getReligionValue(OsmPrimitive osmPrimitive) { … … 408 431 /** 409 432 * 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. 413 434 */ 414 435 public static boolean hasBarrierTag(OsmPrimitive osmPrimitive) { … … 418 439 /** 419 440 * Gets the value of tag 'barrier'. 420 * 421 * @param osmPrimitive 422 * The OSM entity to check. 441 * @param osmPrimitive The OSM entity to check. 423 442 */ 424 443 public static String getBarrierValue(OsmPrimitive osmPrimitive) { … … 428 447 /** 429 448 * 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. 433 450 */ 434 451 public static boolean hasPowerTag(OsmPrimitive osmPrimitive) { … … 438 455 /** 439 456 * Gets the value of tag 'power'. 440 * 441 * @param osmPrimitive 442 * The OSM entity to check. 457 * @param osmPrimitive The OSM entity to check. 443 458 */ 444 459 public static String getPowerValue(OsmPrimitive osmPrimitive) { … … 448 463 /** 449 464 * 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. 453 466 */ 454 467 public static boolean hasLanduseTag(OsmPrimitive osmPrimitive) { … … 458 471 /** 459 472 * Gets the value of tag 'landuse'. 460 * 461 * @param osmPrimitive 462 * The OSM entity to check. 473 * @param osmPrimitive The OSM entity to check. 463 474 */ 464 475 public static String getLanduseValue(OsmPrimitive osmPrimitive) { … … 468 479 /** 469 480 * 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. 473 482 */ 474 483 public static boolean hasFireplaceTag(OsmPrimitive osmPrimitive) { … … 479 488 /** 480 489 * Gets the value of tag 'fireplace'. 481 * 482 * @param osmPrimitive 483 * The OSM entity to check. 490 * @param osmPrimitive The OSM entity to check. 484 491 */ 485 492 public static String getFireplaceValue(OsmPrimitive osmPrimitive) { … … 489 496 /** 490 497 * 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. 494 499 */ 495 500 public static boolean hasIntRefTag(OsmPrimitive osmPrimitive) { … … 499 504 /** 500 505 * 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. 504 507 */ 505 508 public static String getIntRefValue(OsmPrimitive osmPrimitive) { … … 509 512 /** 510 513 * 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. 514 515 */ 515 516 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; 518 518 } 519 519 520 520 /** 521 521 * 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. 525 523 */ 526 524 public static String getWhitewaterSectionGradeValue( … … 532 530 /** 533 531 * 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. 537 533 */ 538 534 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; 541 536 } 542 537 543 538 /** 544 539 * Gets the value of tag 'denomination'. 545 * 546 * @param osmPrimitive 547 * The OSM entity to check. 540 * @param osmPrimitive The OSM entity to check. 548 541 */ 549 542 public static String getDenominationValue(OsmPrimitive osmPrimitive) { … … 553 546 /** 554 547 * 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. 558 549 */ 559 550 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; 562 552 } 563 553 564 554 /** 565 555 * 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. 569 557 */ 570 558 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; 573 560 } 574 561 575 562 /** 576 563 * 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. 580 565 */ 581 566 public static boolean hasWiresTag(OsmPrimitive osmPrimitive) { … … 585 570 /** 586 571 * Gets the value of tag 'wires'. 587 * 588 * @param osmPrimitive 589 * The OSM entity to check. 572 * @param osmPrimitive The OSM entity to check. 590 573 */ 591 574 public static String getWiresValue(OsmPrimitive osmPrimitive) { … … 595 578 /** 596 579 * 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. 600 581 */ 601 582 public static boolean hasLocRefTag(OsmPrimitive osmPrimitive) { … … 605 586 /** 606 587 * 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. 610 589 */ 611 590 public static String getLocRefValue(OsmPrimitive osmPrimitive) { … … 615 594 /** 616 595 * 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. 620 597 */ 621 598 public static boolean hasWidthTag(OsmPrimitive osmPrimitive) { … … 625 602 /** 626 603 * Gets the value of tag 'width'. 627 * 628 * @param osmPrimitive 629 * The OSM entity to check. 604 * @param osmPrimitive The OSM entity to check. 630 605 */ 631 606 public static String getWidthValue(OsmPrimitive osmPrimitive) { … … 635 610 /** 636 611 * 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. 640 613 */ 641 614 public static boolean hasTourismTag(OsmPrimitive osmPrimitive) { … … 645 618 /** 646 619 * Gets the value of tag 'tourism'. 647 * 648 * @param osmPrimitive 649 * The OSM entity to check. 620 * @param osmPrimitive The OSM entity to check. 650 621 */ 651 622 public static String getTourismValue(OsmPrimitive osmPrimitive) { … … 655 626 /** 656 627 * 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. 660 629 */ 661 630 public static boolean hasLeisureTag(OsmPrimitive osmPrimitive) { … … 665 634 /** 666 635 * Gets the value of tag 'leisure'. 667 * 668 * @param osmPrimitive 669 * The OSM entity to check. 636 * @param osmPrimitive The OSM entity to check. 670 637 */ 671 638 public static String getLeisureValue(OsmPrimitive osmPrimitive) { … … 675 642 /** 676 643 * 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. 680 645 */ 681 646 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; 684 648 } 685 649 … … 687 651 * Gets the value of tag 'electrified'. 688 652 * 689 * @param osmPrimitive 690 * The OSM entity to check. 653 * @param osmPrimitive The OSM entity to check. 691 654 */ 692 655 public static String getElectrifiedValue(OsmPrimitive osmPrimitive) { … … 696 659 /** 697 660 * 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. 701 662 */ 702 663 public static boolean hasJunctionTag(OsmPrimitive osmPrimitive) { … … 706 667 /** 707 668 * Gets the value of tag 'junction'. 708 * 709 * @param osmPrimitive 710 * The OSM entity to check. 669 * @param osmPrimitive The OSM entity to check. 711 670 */ 712 671 public static String getJunctionValue(OsmPrimitive osmPrimitive) { … … 716 675 /** 717 676 * 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. 721 678 */ 722 679 public static boolean hasRailwayTag(OsmPrimitive osmPrimitive) { … … 726 683 /** 727 684 * Gets the value of tag 'railway'. 728 * 729 * @param osmPrimitive 730 * The OSM entity to check. 685 * @param osmPrimitive The OSM entity to check. 731 686 */ 732 687 public static String getRailwayValue(OsmPrimitive osmPrimitive) { … … 736 691 /** 737 692 * 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. 741 694 */ 742 695 public static boolean hasVoltageTag(OsmPrimitive osmPrimitive) { … … 746 699 /** 747 700 * Gets the value of tag 'voltage'. 748 * 749 * @param osmPrimitive 750 * The OSM entity to check. 701 * @param osmPrimitive The OSM entity to check. 751 702 */ 752 703 public static String getVoltageValue(OsmPrimitive osmPrimitive) { … … 756 707 /** 757 708 * 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. 761 710 */ 762 711 public static boolean hasBridgeTag(OsmPrimitive osmPrimitive) { … … 766 715 /** 767 716 * Gets the value of tag 'bridge'. 768 * 769 * @param osmPrimitive 770 * The OSM entity to check. 717 * @param osmPrimitive The OSM entity to check. 771 718 */ 772 719 public static String getBridgeValue(OsmPrimitive osmPrimitive) { … … 776 723 /** 777 724 * 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. 781 726 */ 782 727 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; 785 729 } 786 730 787 731 /** 788 732 * 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. 792 734 */ 793 735 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; 796 737 } 797 738 798 739 /** 799 740 * 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. 803 742 */ 804 743 public static boolean hasCommentTag(OsmPrimitive osmPrimitive) { … … 808 747 /** 809 748 * Gets the value of tag 'comment'. 810 * 811 * @param osmPrimitive 812 * The OSM entity to check. 749 * @param osmPrimitive The OSM entity to check. 813 750 */ 814 751 public static String getCommentValue(OsmPrimitive osmPrimitive) { … … 818 755 /** 819 756 * 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. 823 758 */ 824 759 public static boolean hasMaxspeedTag(OsmPrimitive osmPrimitive) { … … 828 763 /** 829 764 * Gets the value of tag 'maxspeed'. 830 * 831 * @param osmPrimitive 832 * The OSM entity to check. 765 * @param osmPrimitive The OSM entity to check. 833 766 */ 834 767 public static String getMaxspeedValue(OsmPrimitive osmPrimitive) { … … 838 771 /** 839 772 * 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. 843 774 */ 844 775 public static boolean hasNaturalTag(OsmPrimitive osmPrimitive) { … … 848 779 /** 849 780 * Gets the value of tag 'natural'. 850 * 851 * @param osmPrimitive 852 * The OSM entity to check. 781 * @param osmPrimitive The OSM entity to check. 853 782 */ 854 783 public static String getNaturalValue(OsmPrimitive osmPrimitive) { … … 858 787 /** 859 788 * 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. 863 790 */ 864 791 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; 867 793 } 868 794 869 795 /** 870 796 * 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. 874 798 */ 875 799 public static String getSacScaleValue(OsmPrimitive osmPrimitive) { … … 879 803 /** 880 804 * 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. 884 806 */ 885 807 public static boolean hasTunnelTag(OsmPrimitive osmPrimitive) { … … 889 811 /** 890 812 * Gets the value of tag 'tunnel'. 891 * 892 * @param osmPrimitive 893 * The OSM entity to check. 813 * @param osmPrimitive The OSM entity to check. 894 814 */ 895 815 public static String getTunnelValue(OsmPrimitive osmPrimitive) { … … 899 819 /** 900 820 * 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. 904 822 */ 905 823 public static boolean hasWaterwayTag(OsmPrimitive osmPrimitive) { … … 909 827 /** 910 828 * Gets the value of tag 'waterway'. 911 * 912 * @param osmPrimitive 913 * The OSM entity to check. 829 * @param osmPrimitive The OSM entity to check. 914 830 */ 915 831 public static String getWaterwayValue(OsmPrimitive osmPrimitive) { … … 919 835 /** 920 836 * 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. 924 838 */ 925 839 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; 928 841 } 929 842 930 843 /** 931 844 * 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. 935 846 */ 936 847 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; 939 849 } 940 850 941 851 /** 942 852 * 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. 946 854 */ 947 855 public static boolean hasHighwayTag(OsmPrimitive osmPrimitive) { … … 951 859 /** 952 860 * Gets the value of tag 'highway'. 953 * 954 * @param osmPrimitive 955 * The OSM entity to check. 861 * @param osmPrimitive The OSM entity to check. 956 862 */ 957 863 public static String getHighwayValue(OsmPrimitive osmPrimitive) { … … 961 867 /** 962 868 * 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. 966 870 */ 967 871 public static boolean hasVehicleTag(OsmPrimitive osmPrimitive) { … … 971 875 /** 972 876 * Gets the value of tag 'vehicle'. 973 * 974 * @param osmPrimitive 975 * The OSM entity to check. 877 * @param osmPrimitive The OSM entity to check. 976 878 */ 977 879 public static String getVehicleValue(OsmPrimitive osmPrimitive) { … … 981 883 /** 982 884 * 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. 986 886 */ 987 887 public static boolean hasHorseTag(OsmPrimitive osmPrimitive) { … … 991 891 /** 992 892 * Gets the value of tag 'horse'. 993 * 994 * @param osmPrimitive 995 * The OSM entity to check. 893 * @param osmPrimitive The OSM entity to check. 996 894 */ 997 895 public static String getHorseValue(OsmPrimitive osmPrimitive) { … … 1001 899 /** 1002 900 * 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. 1006 902 */ 1007 903 public static boolean hasGoodsTag(OsmPrimitive osmPrimitive) { … … 1011 907 /** 1012 908 * Gets the value of tag 'goods'. 1013 * 1014 * @param osmPrimitive 1015 * The OSM entity to check. 909 * @param osmPrimitive The OSM entity to check. 1016 910 */ 1017 911 public static String getGoodsValue(OsmPrimitive osmPrimitive) { … … 1021 915 /** 1022 916 * 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. 1026 918 */ 1027 919 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; 1030 921 } 1031 922 1032 923 /** 1033 924 * Gets the value of tag 'frequency'. 1034 * 1035 * @param osmPrimitive 1036 * The OSM entity to check. 925 * @param osmPrimitive The OSM entity to check. 1037 926 */ 1038 927 public static String getFrequencyValue(OsmPrimitive osmPrimitive) { … … 1042 931 /** 1043 932 * 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. 1047 934 */ 1048 935 public static boolean hasManMadeTag(OsmPrimitive osmPrimitive) { … … 1052 939 /** 1053 940 * 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. 1057 942 */ 1058 943 public static String getManMadeValue(OsmPrimitive osmPrimitive) { … … 1062 947 /** 1063 948 * 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. 1067 950 */ 1068 951 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; 1071 953 } 1072 954 1073 955 /** 1074 956 * 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. 1078 958 */ 1079 959 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; 1082 961 } 1083 962 1084 963 /** 1085 964 * 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. 1089 966 */ 1090 967 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; 1093 969 } 1094 970 1095 971 /** 1096 972 * 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. 1100 974 */ 1101 975 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; 1104 977 } 1105 978 1106 979 /** 1107 980 * 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. 1111 982 */ 1112 983 public static boolean hasAreaTag(OsmPrimitive osmPrimitive) { … … 1116 987 /** 1117 988 * Gets the value of tag 'area'. 1118 * 1119 * @param osmPrimitive 1120 * The OSM entity to check. 989 * @param osmPrimitive The OSM entity to check. 1121 990 */ 1122 991 public static String getAreaValue(OsmPrimitive osmPrimitive) { … … 1126 995 /** 1127 996 * 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. 1131 998 */ 1132 999 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; 1135 1001 } 1136 1002 1137 1003 /** 1138 1004 * 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. 1142 1006 */ 1143 1007 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; 1146 1009 } 1147 1010 1148 1011 /** 1149 1012 * 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. 1153 1014 */ 1154 1015 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; 1157 1017 } 1158 1018 1159 1019 /** 1160 1020 * Gets the value of tag 'wheelchair'. 1161 * 1162 * @param osmPrimitive 1163 * The OSM entity to check. 1021 * @param osmPrimitive The OSM entity to check. 1164 1022 */ 1165 1023 public static String getWheelchairValue(OsmPrimitive osmPrimitive) { … … 1169 1027 /** 1170 1028 * 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. 1174 1030 */ 1175 1031 public static boolean hasNameTag(OsmPrimitive osmPrimitive) { … … 1179 1035 /** 1180 1036 * Gets the value of tag 'name'. 1181 * 1182 * @param osmPrimitive 1183 * The OSM entity to check. 1037 * @param osmPrimitive The OSM entity to check. 1184 1038 */ 1185 1039 public static String getNameValue(OsmPrimitive osmPrimitive) { … … 1189 1043 /** 1190 1044 * 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. 1194 1046 */ 1195 1047 public static boolean hasOnewayTag(OsmPrimitive osmPrimitive) { … … 1199 1051 /** 1200 1052 * Gets the value of tag 'oneway'. 1201 * 1202 * @param osmPrimitive 1203 * The OSM entity to check. 1053 * @param osmPrimitive The OSM entity to check. 1204 1054 */ 1205 1055 public static String getOnewayValue(OsmPrimitive osmPrimitive) { … … 1209 1059 /** 1210 1060 * 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. 1214 1062 */ 1215 1063 public static boolean hasFIXMETag(OsmPrimitive osmPrimitive) { … … 1219 1067 /** 1220 1068 * Gets the value of tag 'FIXME'. 1221 * 1222 * @param osmPrimitive 1223 * The OSM entity to check. 1069 * @param osmPrimitive The OSM entity to check. 1224 1070 */ 1225 1071 public static String getFIXMEValue(OsmPrimitive osmPrimitive) { … … 1229 1075 /** 1230 1076 * 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. 1234 1078 */ 1235 1079 public static boolean hasCapacityTag(OsmPrimitive osmPrimitive) { … … 1239 1083 /** 1240 1084 * Gets the value of tag 'capacity'. 1241 * 1242 * @param osmPrimitive 1243 * The OSM entity to check. 1085 * @param osmPrimitive The OSM entity to check. 1244 1086 */ 1245 1087 public static String getCapacityValue(OsmPrimitive osmPrimitive) { … … 1249 1091 /** 1250 1092 * 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. 1254 1094 */ 1255 1095 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; 1258 1097 } 1259 1098 1260 1099 /** 1261 1100 * Gets the value of tag 'motorcycle'. 1262 * 1263 * @param osmPrimitive 1264 * The OSM entity to check. 1101 * @param osmPrimitive The OSM entity to check. 1265 1102 */ 1266 1103 public static String getMotorcycleValue(OsmPrimitive osmPrimitive) { … … 1270 1107 /** 1271 1108 * 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. 1275 1110 */ 1276 1111 public static boolean hasHgvTag(OsmPrimitive osmPrimitive) { … … 1280 1115 /** 1281 1116 * Gets the value of tag 'hgv'. 1282 * 1283 * @param osmPrimitive 1284 * The OSM entity to check. 1117 * @param osmPrimitive The OSM entity to check. 1285 1118 */ 1286 1119 public static String getHgvValue(OsmPrimitive osmPrimitive) { … … 1290 1123 /** 1291 1124 * 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. 1295 1126 */ 1296 1127 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; 1299 1129 } 1300 1130 1301 1131 /** 1302 1132 * Gets the value of tag 'construction'. 1303 * 1304 * @param osmPrimitive 1305 * The OSM entity to check. 1133 * @param osmPrimitive The OSM entity to check. 1306 1134 */ 1307 1135 public static String getConstructionValue(OsmPrimitive osmPrimitive) { … … 1311 1139 /** 1312 1140 * 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. 1316 1142 */ 1317 1143 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; 1320 1145 } 1321 1146 1322 1147 /** 1323 1148 * 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. 1327 1150 */ 1328 1151 public static String getAddrStateValue(OsmPrimitive osmPrimitive) { … … 1332 1155 /** 1333 1156 * 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. 1337 1158 */ 1338 1159 public static boolean hasLanesTag(OsmPrimitive osmPrimitive) { … … 1342 1163 /** 1343 1164 * Gets the value of tag 'lanes'. 1344 * 1345 * @param osmPrimitive 1346 * The OSM entity to check. 1165 * @param osmPrimitive The OSM entity to check. 1347 1166 */ 1348 1167 public static String getLanesValue(OsmPrimitive osmPrimitive) { … … 1352 1171 /** 1353 1172 * 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. 1357 1174 */ 1358 1175 public static boolean hasNoteTag(OsmPrimitive osmPrimitive) { … … 1362 1179 /** 1363 1180 * Gets the value of tag 'note'. 1364 * 1365 * @param osmPrimitive 1366 * The OSM entity to check. 1181 * @param osmPrimitive The OSM entity to check. 1367 1182 */ 1368 1183 public static String getNoteValue(OsmPrimitive osmPrimitive) { … … 1372 1187 /** 1373 1188 * 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. 1377 1190 */ 1378 1191 public static boolean hasLitTag(OsmPrimitive osmPrimitive) { … … 1382 1195 /** 1383 1196 * Gets the value of tag 'lit'. 1384 * 1385 * @param osmPrimitive 1386 * The OSM entity to check. 1197 * @param osmPrimitive The OSM entity to check. 1387 1198 */ 1388 1199 public static String getLitValue(OsmPrimitive osmPrimitive) { … … 1392 1203 /** 1393 1204 * 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. 1397 1206 */ 1398 1207 public static boolean hasBuildingTag(OsmPrimitive osmPrimitive) { … … 1402 1211 /** 1403 1212 * Gets the value of tag 'building'. 1404 * 1405 * @param osmPrimitive 1406 * The OSM entity to check. 1213 * @param osmPrimitive The OSM entity to check. 1407 1214 */ 1408 1215 public static String getBuildingValue(OsmPrimitive osmPrimitive) { … … 1412 1219 /** 1413 1220 * 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. 1417 1222 */ 1418 1223 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; 1421 1225 } 1422 1226 1423 1227 /** 1424 1228 * Gets the value of tag 'segregated'. 1425 * 1426 * @param osmPrimitive 1427 * The OSM entity to check. 1229 * @param osmPrimitive The OSM entity to check. 1428 1230 */ 1429 1231 public static String getSegregatedValue(OsmPrimitive osmPrimitive) { … … 1433 1235 /** 1434 1236 * 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. 1438 1238 */ 1439 1239 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; 1442 1241 } 1443 1242 1444 1243 /** 1445 1244 * 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. 1449 1246 */ 1450 1247 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; 1453 1249 } 1454 1250 1455 1251 /** 1456 1252 * 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. 1460 1254 */ 1461 1255 public static boolean hasLayerTag(OsmPrimitive osmPrimitive) { … … 1465 1259 /** 1466 1260 * Gets the value of tag 'layer'. 1467 * 1468 * @param osmPrimitive 1469 * The OSM entity to check. 1261 * @param osmPrimitive The OSM entity to check. 1470 1262 */ 1471 1263 public static String getLayerValue(OsmPrimitive osmPrimitive) { … … 1475 1267 /** 1476 1268 * 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. 1480 1270 */ 1481 1271 public static boolean hasSportTag(OsmPrimitive osmPrimitive) { … … 1485 1275 /** 1486 1276 * Gets the value of tag 'sport'. 1487 * 1488 * @param osmPrimitive 1489 * The OSM entity to check. 1277 * @param osmPrimitive The OSM entity to check. 1490 1278 */ 1491 1279 public static String getSportValue(OsmPrimitive osmPrimitive) { … … 1495 1283 /** 1496 1284 * 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. 1500 1286 */ 1501 1287 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; 1504 1289 } 1505 1290 1506 1291 /** 1507 1292 * 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. 1511 1294 */ 1512 1295 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; 1515 1297 } 1516 1298 1517 1299 /** 1518 1300 * 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. 1522 1302 */ 1523 1303 public static boolean hasCuttingTag(OsmPrimitive osmPrimitive) { … … 1527 1307 /** 1528 1308 * Gets the value of tag 'cutting'. 1529 * 1530 * @param osmPrimitive 1531 * The OSM entity to check. 1309 * @param osmPrimitive The OSM entity to check. 1532 1310 */ 1533 1311 public static String getCuttingValue(OsmPrimitive osmPrimitive) { … … 1537 1315 /** 1538 1316 * 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. 1542 1318 */ 1543 1319 public static boolean hasAmenityTag(OsmPrimitive osmPrimitive) { … … 1547 1323 /** 1548 1324 * Gets the value of tag 'amenity'. 1549 * 1550 * @param osmPrimitive 1551 * The OSM entity to check. 1325 * @param osmPrimitive The OSM entity to check. 1552 1326 */ 1553 1327 public static String getAmenityValue(OsmPrimitive osmPrimitive) { … … 1557 1331 /** 1558 1332 * 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. 1562 1334 */ 1563 1335 public static boolean hasAccessTag(OsmPrimitive osmPrimitive) { … … 1567 1339 /** 1568 1340 * Gets the value of tag 'access'. 1569 * 1570 * @param osmPrimitive 1571 * The OSM entity to check. 1341 * @param osmPrimitive The OSM entity to check. 1572 1342 */ 1573 1343 public static String getAccessValue(OsmPrimitive osmPrimitive) { … … 1577 1347 /** 1578 1348 * 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. 1582 1350 */ 1583 1351 public static boolean hasAgriculturalTag(OsmPrimitive osmPrimitive) { … … 1588 1356 /** 1589 1357 * Gets the value of tag 'agricultural'. 1590 * 1591 * @param osmPrimitive 1592 * The OSM entity to check. 1358 * @param osmPrimitive The OSM entity to check. 1593 1359 */ 1594 1360 public static String getAgriculturalValue(OsmPrimitive osmPrimitive) { … … 1598 1364 /** 1599 1365 * 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. 1603 1367 */ 1604 1368 public static boolean hasCapacityDisabledTag(OsmPrimitive osmPrimitive) { … … 1609 1373 /** 1610 1374 * 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. 1614 1376 */ 1615 1377 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; 1618 1379 } 1619 1380 1620 1381 /** 1621 1382 * 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. 1625 1384 */ 1626 1385 public static boolean hasOperatorTag(OsmPrimitive osmPrimitive) { … … 1630 1389 /** 1631 1390 * Gets the value of tag 'operator'. 1632 * 1633 * @param osmPrimitive 1634 * The OSM entity to check. 1391 * @param osmPrimitive The OSM entity to check. 1635 1392 */ 1636 1393 public static String getOperatorValue(OsmPrimitive osmPrimitive) { … … 1640 1397 /** 1641 1398 * 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. 1645 1400 */ 1646 1401 public static boolean hasRefTag(OsmPrimitive osmPrimitive) { … … 1650 1405 /** 1651 1406 * Gets the value of tag 'ref'. 1652 * 1653 * @param osmPrimitive 1654 * The OSM entity to check. 1407 * @param osmPrimitive The OSM entity to check. 1655 1408 */ 1656 1409 public static String getRefValue(OsmPrimitive osmPrimitive) { … … 1660 1413 /** 1661 1414 * 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. 1665 1416 */ 1666 1417 public static boolean hasNoexitTag(OsmPrimitive osmPrimitive) { … … 1670 1421 /** 1671 1422 * Gets the value of tag 'noexit'. 1672 * 1673 * @param osmPrimitive 1674 * The OSM entity to check. 1423 * @param osmPrimitive The OSM entity to check. 1675 1424 */ 1676 1425 public static String getNoexitValue(OsmPrimitive osmPrimitive) { … … 1680 1429 /** 1681 1430 * 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. 1685 1432 */ 1686 1433 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; 1689 1435 } 1690 1436 1691 1437 /** 1692 1438 * 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. 1696 1440 */ 1697 1441 public static String getAdminLevelValue(OsmPrimitive osmPrimitive) { … … 1701 1445 /** 1702 1446 * 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. 1706 1448 */ 1707 1449 public static boolean hasSourceTag(OsmPrimitive osmPrimitive) { … … 1711 1453 /** 1712 1454 * Gets the value of tag 'source'. 1713 * 1714 * @param osmPrimitive 1715 * The OSM entity to check. 1455 * @param osmPrimitive The OSM entity to check. 1716 1456 */ 1717 1457 public static String getSourceValue(OsmPrimitive osmPrimitive) { … … 1721 1461 /** 1722 1462 * 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. 1726 1464 */ 1727 1465 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; 1730 1467 } 1731 1468 1732 1469 /** 1733 1470 * Gets the value of tag 'tracktype'. 1734 * 1735 * @param osmPrimitive 1736 * The OSM entity to check. 1471 * @param osmPrimitive The OSM entity to check. 1737 1472 */ 1738 1473 public static String getTracktypeValue(OsmPrimitive osmPrimitive) { … … 1742 1477 /** 1743 1478 * 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. 1747 1480 */ 1748 1481 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; 1751 1483 } 1752 1484 1753 1485 /** 1754 1486 * 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. 1758 1488 */ 1759 1489 public static String getAddrCountryValue(OsmPrimitive osmPrimitive) { … … 1763 1493 /** 1764 1494 * 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. 1768 1496 */ 1769 1497 public static boolean hasRouteTag(OsmPrimitive osmPrimitive) { … … 1773 1501 /** 1774 1502 * Gets the value of tag 'route'. 1775 * 1776 * @param osmPrimitive 1777 * The OSM entity to check. 1503 * @param osmPrimitive The OSM entity to check. 1778 1504 */ 1779 1505 public static String getRouteValue(OsmPrimitive osmPrimitive) { … … 1783 1509 /** 1784 1510 * 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. 1788 1512 */ 1789 1513 public static boolean hasCablesTag(OsmPrimitive osmPrimitive) { … … 1793 1517 /** 1794 1518 * Gets the value of tag 'cables'. 1795 * 1796 * @param osmPrimitive 1797 * The OSM entity to check. 1519 * @param osmPrimitive The OSM entity to check. 1798 1520 */ 1799 1521 public static String getCablesValue(OsmPrimitive osmPrimitive) { … … 1803 1525 /** 1804 1526 * 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. 1808 1528 */ 1809 1529 public static boolean hasServiceTag(OsmPrimitive osmPrimitive) { … … 1813 1533 /** 1814 1534 * Gets the value of tag 'service'. 1815 * 1816 * @param osmPrimitive 1817 * The OSM entity to check. 1535 * @param osmPrimitive The OSM entity to check. 1818 1536 */ 1819 1537 public static String getServiceValue(OsmPrimitive osmPrimitive) { … … 1823 1541 /** 1824 1542 * 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. 1828 1544 */ 1829 1545 public static boolean hasMotorcarTag(OsmPrimitive osmPrimitive) { … … 1833 1549 /** 1834 1550 * Gets the value of tag 'motorcar'. 1835 * 1836 * @param osmPrimitive 1837 * The OSM entity to check. 1551 * @param osmPrimitive The OSM entity to check. 1838 1552 */ 1839 1553 public static String getMotorcarValue(OsmPrimitive osmPrimitive) { … … 1843 1557 /** 1844 1558 * 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. 1848 1560 */ 1849 1561 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; 1852 1563 } 1853 1564 1854 1565 /** 1855 1566 * Gets the value of tag 'whitewater'. 1856 * 1857 * @param osmPrimitive 1858 * The OSM entity to check. 1567 * @param osmPrimitive The OSM entity to check. 1859 1568 */ 1860 1569 public static String getWhitewaterValue(OsmPrimitive osmPrimitive) { … … 1864 1573 /** 1865 1574 * 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. 1869 1576 */ 1870 1577 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; 1873 1579 } 1874 1580 1875 1581 /** 1876 1582 * Gets the value of tag 'embankment'. 1877 * 1878 * @param osmPrimitive 1879 * The OSM entity to check. 1583 * @param osmPrimitive The OSM entity to check. 1880 1584 */ 1881 1585 public static String getEmbankmentValue(OsmPrimitive osmPrimitive) { … … 1913 1617 /** 1914 1618 * 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. 1918 1620 */ 1919 1621 public static boolean isAssociatedStreetRelation(Relation rel) { … … 1925 1627 /** 1926 1628 * Checks if given relation member has role "street". 1927 *1928 1629 * @param relMember the relation member 1929 1630 * @return true, if is street member … … 1935 1636 /** 1936 1637 * Checks if given relation member has role "house". 1937 *1938 1638 * @param relMember the relation member 1939 1639 * @return true, if is street member … … 1945 1645 /** 1946 1646 * Checks if "addr:state" tag is required. 1947 *1948 1647 * @return true, if is state required 1949 1648 */ … … 1959 1658 return false; 1960 1659 } 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:Hausnummern2075 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";2079 1660 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java
r32701 r32970 70 70 AddressActions.getConvertAllToRelationAction() 71 71 }; 72 72 73 73 private JLabel streetLabel; 74 74 private JLabel unresolvedAddressesLabel; 75 75 private JMapViewer mapViewer; 76 76 77 78 /** 79 * @param arg0 80 * @throws HeadlessException 81 */ 82 public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException { 77 public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException { 83 78 super(JOptionPane.getFrameForComponent(Main.parent), tr("Fix unresolved addresses"), false); 84 79 … … 86 81 this.editContainer.addChangedListener(this); 87 82 setLayout(new BorderLayout()); 88 setSize(1024, 600);83 setSize(1024, 600); 89 84 setLocationRelativeTo(null); 90 85 … … 146 141 headerPanel2.setMinimumSize(new Dimension(100, 30)); 147 142 headerPanel2.add(unresolvedAddressesLabel); 148 unresolvedPanel.add(headerPanel2 143 unresolvedPanel.add(headerPanel2, BorderLayout.NORTH); 149 144 unresolvedPanel.setMinimumSize(new Dimension(500, 200)); 150 145 151 152 146 try { 153 JPanel unresolvedButtons = new JPanel(new GridLayout(2, 5, 5, 5));147 JPanel unresolvedButtons = new JPanel(new GridLayout(2, 5, 5, 5)); 154 148 SideButton assign = new SideButton(AddressActions.getResolveAction()); 155 149 unresolvedButtons.add(assign); … … 214 208 } 215 209 216 JPanel buttonPanel = new JPanel(new GridLayout(1, 10));210 JPanel buttonPanel = new JPanel(new GridLayout(1, 10)); 217 211 JButton ok = new JButton(OK_COMMAND, ImageProvider.getIfAvailable(null, "ok")); 218 212 ok.addActionListener(this); … … 236 230 * @param title The title of the header. 237 231 * @param n The number to show in the header. 238 * @return 232 * @return created header label 239 233 */ 240 234 private JLabel createHeaderLabel(String fmtString, String title, int n) { 241 235 JLabel label = new JLabel(String.format(fmtString, title, n)); 242 236 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)); 244 238 return label; 245 239 } … … 347 341 * street name given in the address. 348 342 * 349 * @author Oliver Wieland <oliver.wieland@online.de>343 * @author Oliver Wieland <oliver.wieland@online.de> 350 344 */ 351 345 class IncompleteAddressListener implements ListSelectionListener { … … 383 377 * event implements this interface, and the object created 384 378 * with that class is registered with a component using the 385 * component's <code>addJumpToEntryListener<code>method. When379 * component's {@code addJumpToEntryListener} method. When 386 380 * the jumpToEntry event occurs, that object's appropriate 387 381 * method is invoked. … … 396 390 * @param column the column of the table to use for the comparison 397 391 */ 398 public JumpToEntryListener(int column) { 399 super(); 392 JumpToEntryListener(int column) { 400 393 this.column = column; 401 394 } … … 403 396 @Override 404 397 public void keyPressed(KeyEvent arg0) { 405 // TODO Auto-generated method stub406 407 398 } 408 399 409 400 @Override 410 401 public void keyReleased(KeyEvent arg0) { 411 // TODO Auto-generated method stub412 413 402 } 414 403 415 404 @Override 416 405 public void keyTyped(KeyEvent arg0) { 417 JTable table 406 JTable table = (JTable) arg0.getSource(); 418 407 419 408 if (table == null) return; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java
r30737 r32970 22 22 private DefaultMutableTreeNode incompleteRoot; 23 23 24 /**25 * @param streets26 * @param unresolvedAddresses27 */28 24 public AddressEditModel(List<OSMStreet> streets, 29 25 List<OSMAddress> unresolvedAddresses) { … … 70 66 /** 71 67 * Gets the tree node containing all unresolved addresses. 72 * @return 68 * @return tree node containing all unresolved addresses 73 69 */ 74 70 public TreeNode getUnresolvedAddressesTree() { … … 89 85 /** 90 86 * Gets the tree node containing all incomplete addresses. 91 * @return 87 * @return tree node containing all incomplete addresses 92 88 */ 93 89 public TreeNode getIncompleteAddressesTree() { -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditSelectionEvent.java
r30737 r32970 33 33 * @param container The address container instance holding the entities for streets and addresses. 34 34 */ 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) { 36 37 super(source, -1, ""); 37 38 this.streetTable = selStreet; … … 43 44 /** 44 45 * Gets the street table component. 45 * @return 46 * @return the street table component 46 47 */ 47 48 public JTable getStreetTable() { … … 51 52 /** 52 53 * Gets the 'unresolved addresses' table component. 53 * @return 54 * @return the 'unresolved addresses' table component 54 55 */ 55 56 public JTable getUnresolvedAddressTable() { … … 75 76 /** 76 77 * Gets the selected street of the street table. 77 * @return 78 * @return the selected street of the street table 78 79 */ 79 80 public OSMStreet getSelectedStreet() { … … 144 145 /** 145 146 * 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 147 148 */ 148 149 public List<OSMAddress> getSelectedUnresolvedAddresses() { -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java
r32771 r32970 37 37 } else { 38 38 SwingUtilities.invokeLater(new Runnable() { 39 39 40 40 @Override 41 41 public void run() { 42 fireTableDataChanged(); // update model 42 fireTableDataChanged(); // update model 43 43 } 44 44 }); … … 55 55 56 56 /** 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. 59 58 * 60 59 * @param row 61 60 * 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 63 62 */ 64 63 public abstract IOSMEntity getEntityOfRow(int row); 65 64 66 65 /** 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. 69 67 * 70 68 * @param entity 71 69 * 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 73 71 */ 74 72 public abstract int getRowOfEntity(IOSMEntity entity); … … 90 88 * event implements this interface, and the object created 91 89 * with that class is registered with a component using the 92 * component's <code>addColumnListener<code>method. When90 * component's {@code addColumnListener} method. When 93 91 * the column event occurs, that object's appropriate 94 92 * method is invoked. … … 104 102 * @param t the t 105 103 */ 106 publicColumnListener(JTable t) {104 ColumnListener(JTable t) { 107 105 table = t; 108 106 } … … 142 140 * Internal base class to sort items by different columns. 143 141 */ 144 protected static abstractclass ColumnSorter<E> implements Comparator<E> {142 protected abstract static class ColumnSorter<E> implements Comparator<E> { 145 143 private int column; 146 144 private boolean ascending; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/BBoxMapRectangle.java
r30348 r32970 12 12 private BBox bbox; 13 13 14 /**15 * @param bbox16 */17 14 public BBoxMapRectangle(BBox bbox) { 18 15 super(null, null); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java
r32771 r32970 11 11 import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress; 12 12 13 public class IncompleteAddressesTableModel extends AddressEditTableModel 13 public class IncompleteAddressesTableModel extends AddressEditTableModel { 14 14 /** 15 15 * … … 19 19 // TODO: Add "state" column, if required 20 20 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<?>[] { 23 24 String.class, String.class, String.class, String.class, String.class, String.class}; 24 25 … … 125 126 * @param asc sort ascending 126 127 */ 127 publicIncompleteAddressModelSorter(int column, boolean asc) {128 IncompleteAddressModelSorter(int column, boolean asc) { 128 129 super(column, asc); 129 130 } … … 135 136 switch (getColumn()) { 136 137 case 0: 137 cc =arg0.getCountry().compareTo(arg1.getCountry());138 cc = arg0.getCountry().compareTo(arg1.getCountry()); 138 139 break; 139 140 case 1: 140 cc =arg0.getCity().compareTo(arg1.getCity());141 cc = arg0.getCity().compareTo(arg1.getCity()); 141 142 break; 142 143 case 2: 143 cc =arg0.getPostalCode().compareTo(arg1.getPostalCode());144 cc = arg0.getPostalCode().compareTo(arg1.getPostalCode()); 144 145 break; 145 146 case 3: 146 cc = arg0.getStreetName().compareTo(arg1.getStreetName());147 cc = arg0.getStreetName().compareTo(arg1.getStreetName()); 147 148 break; 148 149 case 4: 149 cc =arg0.getHouseNumber().compareTo(arg1.getHouseNumber());150 cc = arg0.getHouseNumber().compareTo(arg1.getHouseNumber()); 150 151 break; 151 152 default: … … 160 161 } 161 162 } 162 163 164 163 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java
r32771 r32970 15 15 private static final String[] COLUMN_NAMES = new String[]{tr("Type"), tr("Name"), tr("Addresses")}; 16 16 private static final Class<?>[] COLUMN_CLASSES = new Class<?>[]{String.class, String.class, Integer.class}; 17 /** 18 * @param addressContainer 19 */ 17 20 18 public StreetTableModel(AddressEditContainer addressContainer) { 21 19 super(addressContainer); … … 24 22 @Override 25 23 public int getColumnCount() { 26 // TODO Auto-generated method stub27 24 return NUMBER_OF_COLUMNS; 28 25 } … … 107 104 static class StreetModelSorter extends ColumnSorter<OSMStreet> { 108 105 109 publicStreetModelSorter(int column, boolean asc) {106 StreetModelSorter(int column, boolean asc) { 110 107 super(column, asc); 111 108 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java
r32771 r32970 14 14 * Provides a table model to show unresolved addresses. 15 15 * 16 * @author Oliver Wieland <oliver.wieland@online.de>16 * @author Oliver Wieland <oliver.wieland@online.de> 17 17 * 18 18 */ 19 20 19 public class UnresolvedAddressesTableModel extends AddressEditTableModel { 21 20 22 21 private static final int NUMBER_OF_COLUMNS = 5; 23 private static final String[] COLUMN_NAMES = new String[] { 22 private static final String[] COLUMN_NAMES = new String[] {tr("Street"), 24 23 tr("Number"), trc("address", "City" /* fix #8140 */), tr("Postcode"), tr("Name") }; 25 24 … … 33 32 private static final long serialVersionUID = 424009321818130586L; 34 33 35 /**36 * @param addressContainer37 */38 34 public UnresolvedAddressesTableModel(AddressEditContainer addressContainer) { 39 35 super(addressContainer); … … 130 126 static class UnresolvedAddressModelSorter extends ColumnSorter<OSMAddress> { 131 127 132 publicUnresolvedAddressModelSorter(int column, boolean asc) {128 UnresolvedAddressModelSorter(int column, boolean asc) { 133 129 super(column, asc); 134 130 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java
r32770 r32970 26 26 * accepts a list of addresses or streets and executes the tasks to be done by this action. 27 27 * 28 * @author Oliver Wieland <oliver.wieland@online.de>28 * @author Oliver Wieland <oliver.wieland@online.de> 29 29 */ 30 31 30 @SuppressWarnings("serial") 32 31 public abstract class AbstractAddressEditAction extends JosmAction implements IAddressEditContainerListener, ICommandListener { … … 36 35 private String txName; 37 36 38 /**39 * @param name40 * @param icon41 */42 37 public AbstractAddressEditAction(String name, String iconName, String tooltip, String toolbar) { 43 38 super(name, iconName, tooltip, null, true, toolbar, true); … … 46 41 } 47 42 48 /**49 * @param name50 */51 43 public AbstractAddressEditAction(String name) { 52 44 this(name, null, "", null); … … 120 112 * Updates 'enabled' state depending on the given address container object. 121 113 * @param container The address container (maybe null). 122 * @return123 114 */ 124 115 protected abstract void updateEnabledState(AddressEditContainer container); … … 127 118 * Updates 'enabled' state depending on the current selection. 128 119 * @param container The selection event. 129 * @return130 120 */ 131 121 protected abstract void updateEnabledState(AddressEditSelectionEvent event); … … 133 123 /** 134 124 * Redirected action handler for doing actions on a address selection. 135 * @param ev 125 * @param ev selection event 136 126 */ 137 127 public abstract void addressEditActionPerformed(AddressEditSelectionEvent ev); … … 139 129 /** 140 130 * Redirected action handler for doing actions on an address container. 141 * @param ev131 * @param container address container 142 132 */ 143 133 public abstract void addressEditActionPerformed(AddressEditContainer container); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AddressActions.java
r32399 r32970 3 3 4 4 public final class AddressActions { 5 6 private AddressActions() { 7 // Hide default constructor for utilities classes 8 } 9 5 10 /* Global action objects */ 6 11 public static SelectAddressesInMapAction getSelectAction() { 7 12 return new SelectAddressesInMapAction(); 8 13 } 14 9 15 public static GuessAddressDataAction getGuessAddressAction() { 10 16 return new GuessAddressDataAction(); 11 17 } 18 12 19 public static ApplyAllGuessesAction getApplyGuessesAction() { 13 20 return new ApplyAllGuessesAction(); 14 21 } 22 15 23 public static RemoveAddressTagsAction getRemoveTagsAction() { 16 24 return new RemoveAddressTagsAction(); 17 25 } 26 18 27 public static AssignAddressToStreetAction getResolveAction() { 19 28 return new AssignAddressToStreetAction(); 20 29 } 30 21 31 public static ConvertToRelationAction getConvertToRelationAction() { 22 32 return new ConvertToRelationAction(); 23 33 } 34 24 35 public static ConvertAllToRelationAction getConvertAllToRelationAction() { 25 36 return new ConvertAllToRelationAction(); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java
r30737 r32970 21 21 /** 22 22 * Applies the guessed values for a set of addresses. 23 * @author Oliver Wieland <oliver.wieland@online.de>23 * @author Oliver Wieland <oliver.wieland@online.de> 24 24 * 25 25 */ 26 26 @SuppressWarnings("serial") 27 public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener {27 public class ApplyAllGuessesAction extends AbstractAddressEditAction implements MouseListener { 28 28 private String tag; 29 29 /** … … 102 102 @Override 103 103 public void mouseClicked(MouseEvent e) { 104 JTable table = (JTable) e.getSource();104 JTable table = (JTable) e.getSource(); 105 105 Point p = e.getPoint(); 106 if (e.getClickCount() == 2) {106 if (e.getClickCount() == 2) { 107 107 AddressEditTableModel model = (AddressEditTableModel) table.getModel(); 108 108 if (model != null) { -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AssignAddressToStreetAction.java
r30348 r32970 12 12 * Assigns one or more selected addresses to a street, i. e. the name of the street is 13 13 * used as value for the addr:street tag. 14 * @author Oliver Wieland <oliver.wieland@online.de> 15 * 14 * @author Oliver Wieland <oliver.wieland@online.de> 16 15 */ 17 public class AssignAddressToStreetAction extends AbstractAddressEditAction 16 public class AssignAddressToStreetAction extends AbstractAddressEditAction { 18 17 19 18 /** … … 62 61 // we only accept a selection: nothing to do here 63 62 } 64 65 66 63 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ConvertToRelationAction.java
r30348 r32970 11 11 import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress; 12 12 import org.openstreetmap.josm.plugins.fixAddresses.OSMStreet; 13 import org.openstreetmap.josm.plugins.fixAddresses.Tag Utils;13 import org.openstreetmap.josm.plugins.fixAddresses.TagConstants; 14 14 import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent; 15 15 … … 56 56 Relation r = new Relation(); 57 57 commands.add(new AddCommand(r)); 58 commands.add(new ChangePropertyCommand(r, Tag Utils.NAME_TAG, streetNode.getName()));59 commands.add(new ChangePropertyCommand(r, Tag Utils.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)); 60 60 // add street with role 'street' 61 r.addMember(new RelationMember(Tag Utils.STREET_RELATION_ROLE, streetNode.getOsmObject()));61 r.addMember(new RelationMember(TagConstants.STREET_RELATION_ROLE, streetNode.getOsmObject())); 62 62 63 63 // add address members 64 64 for (OSMAddress addrNode : streetNode.getAddresses()) { 65 65 beginObjectTransaction(addrNode); 66 r.addMember(new RelationMember(Tag Utils.HOUSE_RELATION_ROLE, addrNode.getOsmObject()));66 r.addMember(new RelationMember(TagConstants.HOUSE_RELATION_ROLE, addrNode.getOsmObject())); 67 67 addrNode.setStreetName(null); // remove street name 68 68 finishObjectTransaction(addrNode); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/GuessAddressDataAction.java
r30348 r32970 9 9 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 10 10 import org.openstreetmap.josm.plugins.fixAddresses.GuessAddressRunnable; 11 import org.openstreetmap.josm.plugins.fixAddresses.IProgressMonitorFinishedListener; 11 12 import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress; 12 import org.openstreetmap.josm.plugins.fixAddresses.IProgressMonitorFinishedListener;13 13 import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent; 14 14 … … 17 17 * with city, post code, state,... However, I strongly encourage you to check the result. 18 18 * 19 * @author Oliver Wieland <oliver.wieland@online.de>19 * @author Oliver Wieland <oliver.wieland@online.de> 20 20 */ 21 21 @SuppressWarnings("serial") … … 58 58 /** 59 59 * Internal method to start several threads guessing tag values for the given list of addresses. 60 * @param addrNodes61 60 */ 62 61 private void internalGuessAddresses(List<OSMAddress> nodes) { 63 if (nodes == null) return; 62 if (nodes == null) 63 return; 64 64 65 65 // Launch address guessing thread -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java
r32445 r32970 15 15 /** 16 16 * 17 * @author Oliver Wieland <oliver.wieland@online.de>17 * @author Oliver Wieland <oliver.wieland@online.de> 18 18 * 19 19 */ … … 57 57 /** 58 58 * Internal helper to select the given addresses in the map. 59 * @param addrToSel 59 * @param addrToSel addresses 60 60 */ 61 61 private void internalSelectAddresses(List<OSMAddress> addrToSel) {
Note:
See TracChangeset
for help on using the changeset viewer.