org.apache.commons.lang3.Range.intersectionWith()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(221)

本文整理了Java中org.apache.commons.lang3.Range.intersectionWith方法的一些代码示例,展示了Range.intersectionWith的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.intersectionWith方法的具体详情如下:
包路径:org.apache.commons.lang3.Range
类名称:Range
方法名:intersectionWith

Range.intersectionWith介绍

[英]Calculate the intersection of this and an overlapping Range.
[中]计算该区域与重叠区域的交点。

代码示例

代码示例来源:origin: org.apache.commons/commons-lang3

@Test(expected = IllegalArgumentException.class)
public void testIntersectionWithNull() {
  intRange.intersectionWith(null);
}

代码示例来源:origin: org.apache.commons/commons-lang3

@Test
public void testIntersectionWith() {
  assertSame(intRange, intRange.intersectionWith(intRange));
  assertSame(byteRange, byteRange.intersectionWith(byteRange));
  assertSame(longRange, longRange.intersectionWith(longRange));
  assertSame(floatRange, floatRange.intersectionWith(floatRange));
  assertSame(doubleRange, doubleRange.intersectionWith(doubleRange));
  assertEquals(Range.between(10, 15), intRange.intersectionWith(Range.between(5, 15)));
}

代码示例来源:origin: org.apache.commons/commons-lang3

@Test(expected = IllegalArgumentException.class)
public void testIntersectionWithNonOverlapping() {
  intRange.intersectionWith(Range.between(0, 9));
}

代码示例来源:origin: de.julielab/julielab-entity-evaluator

Range<Integer> intersection = offsetRange.intersectionWith(other.offsetRange);
int intersectionLength = intersection.getMaximum() - intersection.getMinimum();
if (overlapType == OverlapType.CHARS && intersectionLength < overlapSize)

代码示例来源:origin: offbynull/portmapper

Range<Long> leaseTimeRange = addPinholeLeaseTimeRange.intersectionWith(updatePinholeLeaseTimeRange);

相关文章