public class BoundedRangeOperation extends Object
Constructor and Description |
---|
BoundedRangeOperation() |
Modifier and Type | Method and Description |
---|---|
static <T extends Comparable<? super T>> |
gap(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间不相连,则获得两区间中间的间隔部分 |
static <T extends Comparable<? super T>> |
intersection(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则获得该区间与当前区间的交集 |
static <T extends Comparable<? super T>> |
isDisjoint(BoundedRange<T> boundedRange,
BoundedRange<T> other)
boundedRange 是否与other 前区间不相交 |
static <T extends Comparable<? super T>> |
isIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
boundedRange 是否与other 相交 |
static <T extends Comparable<? super T>> |
span(BoundedRange<T> boundedRange,
BoundedRange<T> other)
获得包含当前区间与指定区间的最小的区间
|
static <T extends Comparable<? super T>> |
subAtLeast(BoundedRange<T> boundedRange,
T min)
截取当前区间中大于等于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
subAtMost(BoundedRange<T> boundedRange,
T max)
截取当前区间中小于等于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
subGreatThan(BoundedRange<T> boundedRange,
T min)
截取当前区间中大于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
subLessThan(BoundedRange<T> boundedRange,
T max)
截取当前区间中小于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
unionIfIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则将其与当前区间合并。 |
public static <T extends Comparable<? super T>> BoundedRange<T> unionIfIntersected(BoundedRange<T> boundedRange, BoundedRange<T> other)
other
与当前区间相交,则将其与当前区间合并。T
- 可比较对象类型boundedRange
- 区间other
- 另一个区间public static <T extends Comparable<? super T>> BoundedRange<T> span(BoundedRange<T> boundedRange, BoundedRange<T> other)
T
- 可比较对象类型boundedRange
- 区间other
- 另一个区间public static <T extends Comparable<? super T>> BoundedRange<T> gap(BoundedRange<T> boundedRange, BoundedRange<T> other)
other
与当前区间不相连,则获得两区间中间的间隔部分T
- 可比较对象类型boundedRange
- 区间other
- 另一个区间null
public static <T extends Comparable<? super T>> BoundedRange<T> intersection(BoundedRange<T> boundedRange, BoundedRange<T> other)
other
与当前区间相交,则获得该区间与当前区间的交集T
- 可比较对象类型boundedRange
- 区间other
- 另一个区间null
public static <T extends Comparable<? super T>> BoundedRange<T> subGreatThan(BoundedRange<T> boundedRange, T min)
min
的部分,若min
不在该区间中,则返回当前区间本身T
- 可比较对象类型boundedRange
- 区间min
- 最大的左值public static <T extends Comparable<? super T>> BoundedRange<T> subAtLeast(BoundedRange<T> boundedRange, T min)
min
的部分,若min
不在该区间中,则返回当前区间本身T
- 可比较对象类型boundedRange
- 区间min
- 最大的左值public static <T extends Comparable<? super T>> BoundedRange<T> subLessThan(BoundedRange<T> boundedRange, T max)
max
的部分,若max
不在该区间中,则返回当前区间本身T
- 可比较对象类型boundedRange
- 区间max
- 最大的左值public static <T extends Comparable<? super T>> BoundedRange<T> subAtMost(BoundedRange<T> boundedRange, T max)
max
的部分,若max
不在该区间中,则返回当前区间本身T
- 可比较对象类型boundedRange
- 区间max
- 最大的左值public static <T extends Comparable<? super T>> boolean isIntersected(BoundedRange<T> boundedRange, BoundedRange<T> other)
boundedRange
是否与other
相交T
- 可比较对象类型boundedRange
- 区间other
- 另一个区间public static <T extends Comparable<? super T>> boolean isDisjoint(BoundedRange<T> boundedRange, BoundedRange<T> other)
boundedRange
是否与other
前区间不相交T
- 可比较对象类型boundedRange
- 区间other
- 另一个区间Copyright © 2025. All rights reserved.