title: can i store function names in final hashmap for execution?
body: <p>I'm building an admin controller that work like a terminal emulator in Flex 4.5.
  The server side is Red5 on a tomcat server using Java programming language.</p>
  
  <p>When a user enter a command in his textinput, the command is sent to the red5, in red5 I check if the command exists and return a proper output or an error if the command or parameters don't match.</p>
  
  <p>so for now i use <code>if (command.equals("..") {} else if (command.equals(...</code></p>
  
  <p>Is there a way to store the function name or a reference to the function that should be executed in each command and to execute it?</p>
  
  <p>example:</p>
  
  <pre><code>// creating the hasmap
  HashMap&lt;String,Object&gt; myfunc = new HashMap&lt;String,Object&gt;();
  
  // adding function reference
  myfunc.put("help",executeHelp);
  </code></pre>
  
  <p>or....</p>
  
  <pre><code>myfunc.put("help", "executeHelp"); // writing the name of the function
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>void receiveCommand(String command, Object params[]( {
   myfunc.get(command).&lt;somehow execute the referrened function or string name ? &gt;
  }
  </code></pre>
  
  <p>any ideas?</p>
  
  <p>thank you!</p>