Changeset 16358 in josm for trunk/src/org


Ignore:
Timestamp:
2020-04-19T14:54:59+02:00 (4 years ago)
Author:
simon04
Message:

see #18164 - Rename class to SearchCompilerQueryWizard

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainInitialization.java

    r16321 r16358  
    88import java.util.Arrays;
    99import java.util.Collection;
     10import java.util.Collections;
    1011import java.util.List;
    1112import java.util.Objects;
     
    3738import org.openstreetmap.josm.tools.Logging;
    3839import org.openstreetmap.josm.tools.OpenBrowser;
    39 import org.openstreetmap.josm.tools.OverpassTurboQueryWizard;
    4040import org.openstreetmap.josm.tools.PlatformManager;
    4141import org.openstreetmap.josm.tools.Shortcut;
     
    127127    @Override
    128128    public List<Callable<?>> asynchronousCallableTasks() {
    129         return Arrays.asList(
    130                 OverpassTurboQueryWizard::getInstance
    131             );
     129        return Collections.emptyList();
    132130    }
    133131
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java

    r16355 r16358  
    1616import org.openstreetmap.josm.gui.download.overpass.OverpassWizardRegistration.OverpassWizardCallbacks;
    1717import org.openstreetmap.josm.tools.Logging;
    18 import org.openstreetmap.josm.tools.OverpassTurboQueryWizard;
     18import org.openstreetmap.josm.tools.SearchCompilerQueryWizard;
    1919import org.openstreetmap.josm.tools.UncheckedParseException;
    2020import org.openstreetmap.josm.tools.Utils;
     
    8282
    8383    /**
    84      * Tries to process a search term using {@link OverpassTurboQueryWizard}. If the term cannot
     84     * Tries to process a search term using {@link SearchCompilerQueryWizard}. If the term cannot
    8585     * be parsed, the the corresponding dialog is shown.
    8686     * @param searchTerm The search term to parse.
     
    9191    private Optional<String> tryParseSearchTerm(String searchTerm) {
    9292        try {
    93             return Optional.of(OverpassTurboQueryWizard.getInstance().constructQuery(searchTerm));
     93            return Optional.of(SearchCompilerQueryWizard.getInstance().constructQuery(searchTerm));
    9494        } catch (UncheckedParseException | IllegalStateException ex) {
    9595            Logging.error(ex);
  • trunk/src/org/openstreetmap/josm/tools/SearchCompilerQueryWizard.java

    r16357 r16358  
    2424 * @since 8744 (using tyrasd/overpass-wizard), 16262 (standalone)
    2525 */
    26 public final class OverpassTurboQueryWizard {
    27 
    28     private static final OverpassTurboQueryWizard instance = new OverpassTurboQueryWizard();
     26public final class SearchCompilerQueryWizard {
     27
     28    private static final SearchCompilerQueryWizard instance = new SearchCompilerQueryWizard();
    2929
    3030    /**
     
    3333     * @return the unique instance of this class
    3434     */
    35     public static OverpassTurboQueryWizard getInstance() {
     35    public static SearchCompilerQueryWizard getInstance() {
    3636        return instance;
    3737    }
    3838
    39     private OverpassTurboQueryWizard() {
     39    private SearchCompilerQueryWizard() {
    4040        // private constructor for utility class
    4141    }
     
    182182    private static List<Match> normalizeToDNF(final Match match) {
    183183        if (match instanceof SearchCompiler.And) {
    184             return ((SearchCompiler.And) match).map(OverpassTurboQueryWizard::normalizeToDNF, (lhs, rhs) -> lhs.stream()
     184            return ((SearchCompiler.And) match).map(SearchCompilerQueryWizard::normalizeToDNF, (lhs, rhs) -> lhs.stream()
    185185                    .flatMap(l -> rhs.stream().map(r -> new SearchCompiler.And(l, r)))
    186186                    .collect(Collectors.toList()));
    187187        } else if (match instanceof SearchCompiler.Or) {
    188             return ((SearchCompiler.Or) match).map(OverpassTurboQueryWizard::normalizeToDNF, CompositeList::new);
     188            return ((SearchCompiler.Or) match).map(SearchCompilerQueryWizard::normalizeToDNF, CompositeList::new);
    189189        } else if (match instanceof SearchCompiler.Xor) {
    190190            throw new UnsupportedOperationException(match.toString());
Note: See TracChangeset for help on using the changeset viewer.