本文整理了Java中org.geotools.util.Range.intersects
方法的一些代码示例,展示了Range.intersects
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.intersects
方法的具体详情如下:
包路径:org.geotools.util.Range
类名称:Range
方法名:intersects
[英]Returns true if this range intersects the given range.
[中]如果此范围与给定范围相交,则返回true。
代码示例来源:origin: geotools/geotools
private List<Range<T>> getOverlappingRanges(Range<T> range) {
List<Range<T>> overlapping = new ArrayList<>();
for (Range r : ranges) {
if (r.intersects(range) || contiguous(r, range)) {
overlapping.add(r);
}
}
return overlapping;
}
代码示例来源:origin: geotools/geotools
public MultiRange<T> intersect(MultiRange<T> other) {
List<Range<T>> intersections = new ArrayList<>();
for (Range<T> r1 : ranges) {
for (Range<T> r2 : other.ranges) {
if (r1.intersects(r2)) {
intersections.add((Range<T>) r1.intersect(r2));
}
}
}
return new MultiRange<>(intersections);
}
代码示例来源:origin: geotools/geotools
/**
* Implementation of {@link #intersect(Range)} to be invoked directly by subclasses. "NC" stands
* for "No Cast" - this method do not try to cast the value to a compatible type.
*/
final Range<? extends T> intersectNC(final Range<? extends T> range)
throws IllegalArgumentException {
final Range<? extends T> intersect, min, max;
min = compareMinTo(range.minValue, range.isMinIncluded ? 0 : +1) < 0 ? range : this;
max = compareMaxTo(range.maxValue, range.isMaxIncluded ? 0 : -1) > 0 ? range : this;
if (min == max) {
intersect = min;
} else {
intersect = create(min.minValue, min.isMinIncluded, max.maxValue, max.isMaxIncluded);
}
assert intersect.isEmpty() == !intersects(range) : intersect;
return intersect;
}
代码示例来源:origin: geotools/geotools
if (!intersects(range)) {
subtract = this;
} else {
assert !subtract.intersects(range) : subtract;
final Range<T>[] array = newArray(1);
array[0] = subtract;
代码示例来源:origin: org.geoserver/gs-wms
private boolean rangeFilterAccepts(Range rangeFilter, Object domainValue) {
if (rangeFilter == null) {
return true;
}
if (domainValue instanceof Range) {
return rangeFilter.intersects((Range) domainValue);
} else {
return rangeFilter.contains((Comparable) domainValue);
}
}
代码示例来源:origin: org.geoserver/gs-wms
Range rb = (Range) b;
if (ra.intersects(rb)) {
return 0;
} else if (ra.getMinValue().compareTo(rb.getMaxValue()) >= 0) {
代码示例来源:origin: org.geotools/gt-metadata
/**
* Implementation of {@link #intersect(Range)} to be invoked directly by subclasses.
* "NC" stands for "No Cast" - this method do not try to cast the value to a compatible type.
*/
final Range<? extends T> intersectNC(final Range<? extends T> range)
throws IllegalArgumentException
{
final Range<? extends T> intersect, min, max;
min = compareMinTo(range.minValue, range.isMinIncluded ? 0 : +1) < 0 ? range : this;
max = compareMaxTo(range.maxValue, range.isMaxIncluded ? 0 : -1) > 0 ? range : this;
if (min == max) {
intersect = min;
} else {
intersect = create(min.minValue, min.isMinIncluded, max.maxValue, max.isMaxIncluded);
}
assert intersect.isEmpty() == !intersects(range) : intersect;
return intersect;
}
代码示例来源:origin: org.geotools/gt-metadata
if (!intersects(range)) {
subtract = this;
} else {
assert !subtract.intersects(range) : subtract;
final Range<T>[] array = newArray(1);
array[0] = subtract;
内容来源于网络,如有侵权,请联系作者删除!