Changeset 12656 in josm for trunk/src/org/openstreetmap/josm/data/osm/search/PushbackTokenizer.java
- Timestamp:
- 2017-08-26T00:40:19+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/search
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/search/PushbackTokenizer.java
r12651 r12656 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. actions.search;2 package org.openstreetmap.josm.data.osm.search; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.marktr; … … 11 11 import java.util.Objects; 12 12 13 import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;14 13 import org.openstreetmap.josm.tools.JosmRuntimeException; 15 14 … … 17 16 * This class is used to parse a search string and split it into tokens. 18 17 * It provides methods to parse numbers and extract strings. 18 * @since 12656 (moved from actions.search package) 19 19 */ 20 20 public class PushbackTokenizer { … … 300 300 * @param errorMessage The error if the number cannot be read 301 301 * @return The number that was found 302 * @throws ParseError if there is no number303 */ 304 public long readNumber(String errorMessage) throws ParseError {302 * @throws SearchParseError if there is no number 303 */ 304 public long readNumber(String errorMessage) throws SearchParseError { 305 305 if ((nextToken() == Token.KEY) && (currentNumber != null)) 306 306 return currentNumber; 307 307 else 308 throw new ParseError(errorMessage);308 throw new SearchParseError(errorMessage); 309 309 } 310 310 … … 321 321 * @param errorMessage The error if the input is malformed 322 322 * @return The range that was found 323 * @throws ParseError If the input is not as expected for a range324 */ 325 public Range readRange(String errorMessage) throws ParseError {323 * @throws SearchParseError If the input is not as expected for a range 324 */ 325 public Range readRange(String errorMessage) throws SearchParseError { 326 326 if (nextToken() != Token.KEY || (currentNumber == null && currentRange == null)) { 327 throw new ParseError(errorMessage);327 throw new SearchParseError(errorMessage); 328 328 } else if (!isRange && currentNumber != null) { 329 329 if (currentNumber >= 0) { … … 337 337 return new Range(currentNumber, currentRange); 338 338 } else { 339 throw new ParseError(errorMessage);339 throw new SearchParseError(errorMessage); 340 340 } 341 341 }
Note:
See TracChangeset
for help on using the changeset viewer.