KInterval.intersection() method
求当前区间和另外一个区间的相交部分,返回相交部分的区间。如果两个区间不相交,则返回一个不合法区间。
Get the intersected part between current interval and the other interval. If two intervals are not intersected, then return an invalid interval.
Signature:
intersection(interval: KInterval): KInterval;
Parameters
Parameter | Type | Description |
---|---|---|
interval | 另外一个区间。 The other interval. |
Returns:
两个区间的相交部分。如果两个区间不相交,则返回一个不合法区间。
A new interval for the intersected parts of the two intervals. If two intervals are not intersected, then return an invalid interval.