Welcome to mirror list, hosted at ThFree Co, Russian Federation.

HiddenCommand.java « search « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 435839d5032faba4632045bb4510176ee02155de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.mapswithme.maps.search;

import android.support.annotation.NonNull;

interface HiddenCommand
{
  /**
   * Executes the specified command.
   *
   * @return true if the command has been executed, otherwise - false.
   */
  boolean execute(@NonNull String command);

  abstract class BaseHiddenCommand implements HiddenCommand
  {
    @NonNull
    private final String mCommand;

    BaseHiddenCommand(@NonNull String command)
    {
      mCommand = command;
    }

    @Override
    public boolean execute(@NonNull String command)
    {
      if (!mCommand.equals(command))
        return false;

      executeInternal();
      return true;
    }

    abstract void executeInternal();
  }
}