- Timestamp:
- 2016-09-17T23:13:48+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/NameFinder.java
r11009 r11016 7 7 import java.io.Reader; 8 8 import java.net.URL; 9 import java.util.Collections; 9 10 import java.util.LinkedList; 10 11 import java.util.List; … … 40 41 } 41 42 43 /** 44 * Performs a Nominatim search. 45 * @param searchExpression Nominatim search expression 46 * @return search results 47 * @throws IOException if any IO error occurs. 48 */ 42 49 public static List<SearchResult> queryNominatim(final String searchExpression) throws IOException { 43 50 return query(new URL(NOMINATIM_URL + Utils.encodeUrl(searchExpression))); 44 51 } 45 52 53 /** 54 * Performs a custom search. 55 * @param url search URL to any Nominatim instance 56 * @return search results 57 * @throws IOException if any IO error occurs. 58 */ 46 59 public static List<SearchResult> query(final URL url) throws IOException { 47 60 final HttpClient connection = HttpClient.create(url); … … 54 67 } 55 68 69 /** 70 * Parse search results as returned by Nominatim. 71 * @param reader reader 72 * @return search results 73 * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration. 74 * @throws SAXException for SAX errors. 75 * @throws IOException if any IO error occurs. 76 */ 56 77 public static List<SearchResult> parseSearchResults(Reader reader) throws IOException, ParserConfigurationException, SAXException { 57 78 InputSource inputSource = new InputSource(reader); … … 249 270 250 271 public List<SearchResult> getResult() { 251 return data;272 return Collections.unmodifiableList(data); 252 273 } 253 274 }
Note:
See TracChangeset
for help on using the changeset viewer.