Potentially dumb:
Assuming I have a string containing an operator what’s the best way to apply this operator ?
What i tend to do is :
if(n.getString(1).equals("<<")) {
result = tmp1 << tmp2;
}
for each kind of operator I have. Is there a better way ?
Could do something like:
the return the right one will be really nice once switch statements are go for
Strings.This solution looks like the following in use (sans
Operator.if you use a static import):but I’d go with someone else’s widely-tested and used parser.