code: public void setContextLimits(int contextStart, int contextLimit) {
          if(contextStart<0) {
              this.contextStart=0;
          } else if(contextStart<=rep.length()) {
              this.contextStart=contextStart;
          } else {
              this.contextStart=rep.length();
          }
          if(contextLimit<this.contextStart) {
              this.contextLimit=this.contextStart;
          } else if(contextLimit<=rep.length()) {
              this.contextLimit=contextLimit;
          } else {
              this.contextLimit=rep.length();
          }
          reachedLimit=false;
      }
docs: Set the start and limit indexes for context iteration with next().
  @param contextStart Start of context for next().
  @param contextLimit Limit of context for next().