protected void shiftGap(int newGapStart){
  if (newGapStart == g0) {
    return;
  }
  int oldGapStart=g0;
  int dg=newGapStart - oldGapStart;
  int oldGapEnd=g1;
  int newGapEnd=oldGapEnd + dg;
  int gapSize=oldGapEnd - oldGapStart;
  g0=newGapStart;
  g1=newGapEnd;
  if (dg > 0) {
    System.arraycopy(array,oldGapEnd,array,oldGapStart,dg);
  }
 else   if (dg < 0) {
    System.arraycopy(array,newGapStart,array,newGapEnd,-dg);
  }
}

protected void shiftGap ( int newGapStart ) { if ( newGapStart == g0 ) { return ; } int oldGapStart = g0 ; int dg = newGapStart - oldGapStart ; int oldGapEnd = g1 ; int newGapEnd = oldGapEnd + dg ; int gapSize = oldGapEnd - oldGapStart ; g0 = newGapStart ; g1 = newGapEnd ; if ( dg > 0 ) { System . arraycopy ( array , oldGapEnd , array , oldGapStart , dg ) ; } else if ( dg < 0 ) { System . arraycopy ( array , newGapStart , array , newGapEnd , - dg ) ; } }
move the start of the gap to a new location , without changing the size of the gap . this moves the data in the array and updates the marks accordingly .
