code: public void reset(int direction) {
          if(direction>0) {
              /* reset for forward iteration */
              this.dir=1;
              index=cpLimit;
          } else if(direction<0) {
              /* reset for backward iteration */
              this.dir=-1;
              index=cpStart;
          } else {
              // not a valid direction
              this.dir=0;
              index=0;
          }
          reachedLimit=false;
      }
docs: implement UCaseProps.ContextIterator