this.depth = 1;
}
- public MInterval Copy (int start, int end, MInterval interval)
+ private MInterval find (int pos)
{
- MInterval new_interval;
+ if (pos < total_start || total_end < pos)
+ return null;
+ if (pos < Start)
+ return left.find (pos);
+ if (End < pos)
+ return right.find (pos);
+ return this;
+ }
+
+ public MInterval Copy (int start, int end)
+ {
+ MInterval interval_start = find (start);
+ MInterval interval_end = find (end);
+ MInterval interval;
start = adjust_position (start, true);
end = adjust_position (end, true);
- new_interval = new MInterval (start, end, interval.stack);
- return new_interval;
+ interval = new MInterval (start, end, stack);
+ return interval;
}
private MInterval Copy ()