Ignore:
Timestamp:
2017-08-26T00:40:19+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - move SearchCompiler from actions.search to data.osm.search

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  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.actions.search;
     2package org.openstreetmap.josm.data.osm.search;
    33
    44import static org.openstreetmap.josm.tools.I18n.marktr;
     
    1111import java.util.Objects;
    1212
    13 import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
    1413import org.openstreetmap.josm.tools.JosmRuntimeException;
    1514
     
    1716 * This class is used to parse a search string and split it into tokens.
    1817 * It provides methods to parse numbers and extract strings.
     18 * @since 12656 (moved from actions.search package)
    1919 */
    2020public class PushbackTokenizer {
     
    300300     * @param errorMessage The error if the number cannot be read
    301301     * @return The number that was found
    302      * @throws ParseError if there is no number
    303      */
    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 {
    305305        if ((nextToken() == Token.KEY) && (currentNumber != null))
    306306            return currentNumber;
    307307        else
    308             throw new ParseError(errorMessage);
     308            throw new SearchParseError(errorMessage);
    309309    }
    310310
     
    321321     * @param errorMessage The error if the input is malformed
    322322     * @return The range that was found
    323      * @throws ParseError If the input is not as expected for a range
    324      */
    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 {
    326326        if (nextToken() != Token.KEY || (currentNumber == null && currentRange == null)) {
    327             throw new ParseError(errorMessage);
     327            throw new SearchParseError(errorMessage);
    328328        } else if (!isRange && currentNumber != null) {
    329329            if (currentNumber >= 0) {
     
    337337            return new Range(currentNumber, currentRange);
    338338        } else {
    339             throw new ParseError(errorMessage);
     339            throw new SearchParseError(errorMessage);
    340340        }
    341341    }
Note: See TracChangeset for help on using the changeset viewer.