2013-10-31 :-(
_ 午後
1300 コード書いたり
_ eclipse に既存の Android プロジェクトを import する
bk
既存プロジェクトが以下にあるとする。
C:\home\rin\work\Android\Hello
File - Import - Android - Existing Android Code Into Worskspace
を選択して Root Directory に
C:\home\rin\work\Android\Hello
を選択すると怒られる。
C:\home\rin\work\Android\Hello overlaps the location of another project: 'Hello'
正しいのはこう
File - Import - General - Existing Project into Worskspace
Select root directory に以下を入力
C:\home\rin\work\Android\Hello
おk
ref. Eclipse Issue: ".. overlaps the location of another project .. " - Fledglings' nook
_ [関数ポインタ][Command][デザインパターン][Java]Java で Command パターン?
関数ポインタが無いから interface を作るのが定石らしいんだけど、マジすか。クラスが量産されるん?
動作未確認
public interface Command
{
  String command(String msg);
}
public class CommandA implements Command
{
  public String command(String msg)
  {
    return "CommandA";
  }
}
public class CommandB implements Command
{
  public String command(String msg)
  {
    return "CommandB";
  }
}
public class CommandC implements Command
{
  public String command(String msg)
  {
    return "CommandC";
  }
}
public static void main(String[] args)
{
  ArrayList list = new ArrayList();
  list.add(new CommandA());
  list.add(new CommandB());
  list.add(new CommandC());
  for (int i = 0; i < list.size(); i++)
  {
    System.out.println(list.get(i));
  }
}
ref. たぶんら - Javaで関数ポインタ
[ツッコミを入れる]











