protected void dispose(IInterval interval){
  if (intervals == null) {
    return;
  }
  for (int i=intervals.size() - 1; i >= 0; i--) {
    IInterval ival=intervals.get(i);
    if ((interval.getLeft() == ival.getLeft()) && (interval.getRight() == ival.getRight())) {
      intervals.remove(i);
      break;
    }
  }
}

protected void dispose ( IInterval interval ) { if ( intervals == null ) { return ; } for ( int i = intervals . size ( ) - 1 ; i >= 0 ; i -- ) { IInterval ival = intervals . get ( i ) ; if ( ( interval . getLeft ( ) == ival . getLeft ( ) ) && ( interval . getRight ( ) == ival . getRight ( ) ) ) { intervals . remove ( i ) ; break ; } } }
algorithms over segmenttrees often store additional information with each node , and may wish to clear information and / or perform computations when a segment is deleted . this method is overridden by subclasses as required . for dynamic reasons , search from end to front .
