本文整理了Java中org.apache.commons.lang3.Range.intersectionWith
方法的一些代码示例,展示了Range.intersectionWith
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.intersectionWith
方法的具体详情如下:
包路径:org.apache.commons.lang3.Range
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!