title: How to keep a "things done" count in a recursive algorithm in Java?
body: <p>I have a recursive algorithm which steps through a string, character by character, and parses it to create a tree-like structure.  I want to be able to keep track of the character index the parser is currently at (for error messages as much as anything else) but am not keen on implementing something like a tuple to handle multiple returned types.</p>
  
  <p>I tried using an Integer type, declared outside the method and passed into the recursive method, but because it's final, recursive call increments are "forgotten" when I return. (Because the increment of the Integer value makes the passed-by-value object reference point at a new object)</p>
  
  <p>Is there a way to get something similar to work which won't pollute my code?</p>