code: public int moveIndex(int delta) {
          int x = Math.max(0, Math.min(getIndex() + delta, getLength()));
          setIndex(x);
          return x;
      }
docs: Moves the current position by the number of code units specified, either forward or backward depending on the
  sign of delta (positive or negative respectively). If the resulting index would be less than zero, the index is
  set to zero, and if the resulting index would be greater than limit, the index is set to limit.
  
  @param delta
  the number of code units to move the current index.
  @return the new index.
  @exception IndexOutOfBoundsException
  is thrown if an invalid index is supplied