Package | Description |
---|---|
org.dromara.hutool.core.lang.range |
提供区间和边界封装,主要包括:
Bound : 提供边界的抽象表示,包括边界范围、开闭区间等。 |
Modifier and Type | Method and Description |
---|---|
static <T extends Comparable<? super T>> |
BoundedRange.all()
构建一个上下界皆无限大的区间,即
{x | -∞ < x < +∞} |
static <T extends Comparable<? super T>> |
BoundedRange.atLeast(T lowerBound)
{x | lowerBound < x < +∞} |
static <T extends Comparable<? super T>> |
BoundedRange.atMost(T upperBound)
{x | -∞ < x <= max} |
static <T extends Comparable<? super T>> |
BoundedRange.close(T lowerBound,
T upperBound)
构建一个闭区间,即
{x | lowerBound <= x <= upperBound} |
static <T extends Comparable<? super T>> |
BoundedRange.closeOpen(T lowerBound,
T upperBound)
构建一个左闭右开区间,即
{x | lowerBound <= x < upperBound} |
BoundedRange<T> |
BoundedRange.gap(BoundedRange<T> other)
若
other 与当前区间不相连,则获得两区间中间的间隔部分 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.gap(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间不相连,则获得两区间中间的间隔部分 |
static <T extends Comparable<? super T>> |
BoundedRange.greaterThan(T lowerBound)
{x | lowerBound < x < +∞} |
BoundedRange<T> |
BoundedRange.intersection(BoundedRange<T> other)
若
other 与当前区间相交,则获得该区间与当前区间的交集 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.intersection(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则获得该区间与当前区间的交集 |
static <T extends Comparable<? super T>> |
BoundedRange.lessThan(T upperBound)
{x | -∞ < x < upperBound} |
static <T extends Comparable<? super T>> |
BoundedRange.open(T lowerBound,
T upperBound)
构建一个开区间,即
{x | lowerBound < x < upperBound} |
static <T extends Comparable<? super T>> |
BoundedRange.openClose(T lowerBound,
T upperBound)
构建一个左闭右开区间,即
{x | lowerBound < x <= upperBound} |
BoundedRange<T> |
BoundedRange.span(BoundedRange<T> other)
获得包含当前区间与指定区间的最小的区间
|
static <T extends Comparable<? super T>> |
BoundedRangeOperation.span(BoundedRange<T> boundedRange,
BoundedRange<T> other)
获得包含当前区间与指定区间的最小的区间
|
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subAtLeast(BoundedRange<T> boundedRange,
T min)
截取当前区间中大于等于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
BoundedRange<T> |
BoundedRange.subAtLeast(T min)
截取当前区间中大于等于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subAtMost(BoundedRange<T> boundedRange,
T max)
截取当前区间中小于等于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
BoundedRange<T> |
BoundedRange.subAtMost(T max)
截取当前区间中小于等于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subGreatThan(BoundedRange<T> boundedRange,
T min)
截取当前区间中大于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
BoundedRange<T> |
BoundedRange.subGreatThan(T min)
截取当前区间中大于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subLessThan(BoundedRange<T> boundedRange,
T max)
截取当前区间中小于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
BoundedRange<T> |
BoundedRange.subLessThan(T max)
截取当前区间中小于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
BoundedRange<T> |
Bound.toRange()
将当前实例转为一个区间
|
BoundedRange<T> |
BoundedRange.unionIfIntersected(BoundedRange<T> other)
若
other 与当前区间相交,则将其与当前区间合并。 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.unionIfIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则将其与当前区间合并。 |
Modifier and Type | Method and Description |
---|---|
BoundedRange<T> |
BoundedRange.gap(BoundedRange<T> other)
若
other 与当前区间不相连,则获得两区间中间的间隔部分 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.gap(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间不相连,则获得两区间中间的间隔部分 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.gap(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间不相连,则获得两区间中间的间隔部分 |
BoundedRange<T> |
BoundedRange.intersection(BoundedRange<T> other)
若
other 与当前区间相交,则获得该区间与当前区间的交集 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.intersection(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则获得该区间与当前区间的交集 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.intersection(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则获得该区间与当前区间的交集 |
boolean |
BoundedRange.isDisjoint(BoundedRange<T> other)
other 是否与当前区间不相交 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.isDisjoint(BoundedRange<T> boundedRange,
BoundedRange<T> other)
boundedRange 是否与other 前区间不相交 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.isDisjoint(BoundedRange<T> boundedRange,
BoundedRange<T> other)
boundedRange 是否与other 前区间不相交 |
boolean |
BoundedRange.isIntersected(BoundedRange<T> other)
other 是否与当前区间相交: |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.isIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
boundedRange 是否与other 相交 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.isIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
boundedRange 是否与other 相交 |
boolean |
BoundedRange.isProperSubset(BoundedRange<T> other)
当前区间是否是
other 的真子集 |
boolean |
BoundedRange.isProperSuperset(BoundedRange<T> other)
other 是否是当前区间的子集 |
boolean |
BoundedRange.isSubset(BoundedRange<T> other)
当前区间是否是
other 的子集 |
boolean |
BoundedRange.isSuperset(BoundedRange<T> other)
other 是否是当前区间的子集 |
BoundedRange<T> |
BoundedRange.span(BoundedRange<T> other)
获得包含当前区间与指定区间的最小的区间
|
static <T extends Comparable<? super T>> |
BoundedRangeOperation.span(BoundedRange<T> boundedRange,
BoundedRange<T> other)
获得包含当前区间与指定区间的最小的区间
|
static <T extends Comparable<? super T>> |
BoundedRangeOperation.span(BoundedRange<T> boundedRange,
BoundedRange<T> other)
获得包含当前区间与指定区间的最小的区间
|
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subAtLeast(BoundedRange<T> boundedRange,
T min)
截取当前区间中大于等于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subAtMost(BoundedRange<T> boundedRange,
T max)
截取当前区间中小于等于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subGreatThan(BoundedRange<T> boundedRange,
T min)
截取当前区间中大于
min 的部分,若min 不在该区间中,则返回当前区间本身 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.subLessThan(BoundedRange<T> boundedRange,
T max)
截取当前区间中小于
max 的部分,若max 不在该区间中,则返回当前区间本身 |
BoundedRange<T> |
BoundedRange.unionIfIntersected(BoundedRange<T> other)
若
other 与当前区间相交,则将其与当前区间合并。 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.unionIfIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则将其与当前区间合并。 |
static <T extends Comparable<? super T>> |
BoundedRangeOperation.unionIfIntersected(BoundedRange<T> boundedRange,
BoundedRange<T> other)
若
other 与当前区间相交,则将其与当前区间合并。 |
Copyright © 2025. All rights reserved.