title: Calculator without if/else or switch
body: <p>I am trying to write calculator for <code>+ - * /</code> without conditions. The operator is stored as a string. </p>
  
  <p>Is there anyway to achieve it?</p>
  
  <pre><code>public class Main {
  
      /**
       * @param args
       */
      public static void main(String[] args) {
          ////String Operator = "";
          String L1="";
          String L2="";
          String op = "+";
          double a = 3;
          double b = 2;
  
          //Operator p = p.
          Operator p;
          b = Operator.count(a, op, b);
          System.out.println(b);
      }
  
      public enum Operator {
          PLUS("+"), MINUS("-"), DIVIDE("/"), MULTIPLY("*");
  
          private final String operator;
  
          public static double count(double a,String op,double b) {
              double RetVal =0;
              switch (Operator.valueOf(op)) {
              case PLUS:
                  RetVal= a + b;
              case MINUS:
                  RetVal= a - b;
              case DIVIDE:
                  RetVal= a / b;
              case MULTIPLY:
                  RetVal= a * b;
              }
              return RetVal;
          }
  
          Operator(String operator) {
              this.operator = operator;
  
          }
          // uniwersalna stała grawitacyjna (m3 kg-1 s-2)
      }
  
  }
  </code></pre>
  
  <p>Got this error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalArgumentException: No enum const class Main$Operator.+</p>
  </blockquote>
  
  <p>Any clues?</p>