title: Call a function from a string array (Java or Groovy)
body: <p>In Java, or Groovy, say I have a String array like</p>
  
  <pre><code>myArray = ["SA1", "SA2", "SA3", "SA4"]
  </code></pre>
  
  <p>I want to call a different function based off of each string.</p>
  
  <pre><code>class Myclass{
    public static void SA1() {
      //doMyStuff
    }
    public static void SA2() {
      //doMyStuff
    }
    ...etc
  }
  </code></pre>
  
  <p>I would love to be able to loop through my array and call the functions that they pertain to without having to compare the string or make a case statement. For example is there a way to do something like the following, I know it doesn't currently work:</p>
  
  <pre><code>Myclass[myArray[0]]();
  </code></pre>
  
  <p>Or if you have suggestions of another way I can structure something similar.</p>