Calculate arithmetic expression represented by a string, in Java
If your logic is too complicated, why don't you try to separate the concerns. You may create a Parser that will contains more well-named method to parse handle the characters in your stream. This one can either produce an object that is evaluated to produce your result or it can call methods on another class to evaluate each expression as soon as they are found (like the DOM vs SAX parsers).