com.google.common.collect.Range.lowerBoundFn()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(123)

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

Range.lowerBoundFn介绍

暂无

代码示例

代码示例来源:origin: google/guava

@Override
public boolean encloses(Range<C> otherRange) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     otherRange.lowerBound,
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_LOWER);
 return index != -1 && ranges.get(index).encloses(otherRange);
}

代码示例来源:origin: google/guava

@Override
public Range<C> rangeContaining(C value) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     Cut.belowValue(value),
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_LOWER);
 if (index != -1) {
  Range<C> range = ranges.get(index);
  return range.contains(value) ? range : null;
 }
 return null;
}

代码示例来源:origin: google/j2objc

@Override
public boolean encloses(Range<C> otherRange) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     otherRange.lowerBound,
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_LOWER);
 return index != -1 && ranges.get(index).encloses(otherRange);
}

代码示例来源:origin: google/guava

@Override
public @Nullable Entry<Range<K>, V> getEntry(K key) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<K>lowerBoundFn(),
     Cut.belowValue(key),
     KeyPresentBehavior.ANY_PRESENT,
     KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? Maps.immutableEntry(range, values.get(index)) : null;
 }
}

代码示例来源:origin: google/guava

@Override
public @Nullable V get(K key) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<K>lowerBoundFn(),
     Cut.belowValue(key),
     KeyPresentBehavior.ANY_PRESENT,
     KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? values.get(index) : null;
 }
}

代码示例来源:origin: wildfly/wildfly

@Override
public boolean encloses(Range<C> otherRange) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     otherRange.lowerBound,
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_LOWER);
 return index != -1 && ranges.get(index).encloses(otherRange);
}

代码示例来源:origin: google/j2objc

@Override
public Range<C> rangeContaining(C value) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     Cut.belowValue(value),
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_LOWER);
 if (index != -1) {
  Range<C> range = ranges.get(index);
  return range.contains(value) ? range : null;
 }
 return null;
}

代码示例来源:origin: google/guava

@Override
public boolean intersects(Range<C> otherRange) {
 int ceilingIndex =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     otherRange.lowerBound,
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_HIGHER);
 if (ceilingIndex < ranges.size()
   && ranges.get(ceilingIndex).isConnected(otherRange)
   && !ranges.get(ceilingIndex).intersection(otherRange).isEmpty()) {
  return true;
 }
 return ceilingIndex > 0
   && ranges.get(ceilingIndex - 1).isConnected(otherRange)
   && !ranges.get(ceilingIndex - 1).intersection(otherRange).isEmpty();
}

代码示例来源:origin: google/j2objc

@Override
@NullableDecl
public Entry<Range<K>, V> getEntry(K key) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<K>lowerBoundFn(),
     Cut.belowValue(key),
     KeyPresentBehavior.ANY_PRESENT,
     KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? Maps.immutableEntry(range, values.get(index)) : null;
 }
}

代码示例来源:origin: wildfly/wildfly

@Override
public Range<C> rangeContaining(C value) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     Cut.belowValue(value),
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_LOWER);
 if (index != -1) {
  Range<C> range = ranges.get(index);
  return range.contains(value) ? range : null;
 }
 return null;
}

代码示例来源:origin: wildfly/wildfly

@Override
@NullableDecl
public Entry<Range<K>, V> getEntry(K key) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<K>lowerBoundFn(),
     Cut.belowValue(key),
     KeyPresentBehavior.ANY_PRESENT,
     KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? Maps.immutableEntry(range, values.get(index)) : null;
 }
}

代码示例来源:origin: wildfly/wildfly

@Override
@NullableDecl
public V get(K key) {
 int index =
   SortedLists.binarySearch(
     ranges,
     Range.<K>lowerBoundFn(),
     Cut.belowValue(key),
     KeyPresentBehavior.ANY_PRESENT,
     KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? values.get(index) : null;
 }
}

代码示例来源:origin: wildfly/wildfly

@Override
public boolean intersects(Range<C> otherRange) {
 int ceilingIndex =
   SortedLists.binarySearch(
     ranges,
     Range.<C>lowerBoundFn(),
     otherRange.lowerBound,
     Ordering.natural(),
     ANY_PRESENT,
     NEXT_HIGHER);
 if (ceilingIndex < ranges.size()
   && ranges.get(ceilingIndex).isConnected(otherRange)
   && !ranges.get(ceilingIndex).intersection(otherRange).isEmpty()) {
  return true;
 }
 return ceilingIndex > 0
   && ranges.get(ceilingIndex - 1).isConnected(otherRange)
   && !ranges.get(ceilingIndex - 1).intersection(otherRange).isEmpty();
}

代码示例来源:origin: google/guava

SortedLists.binarySearch(
  ranges,
  Range.<C>lowerBoundFn(),
  range.upperBound,
  KeyPresentBehavior.FIRST_PRESENT,

代码示例来源:origin: google/guava

SortedLists.binarySearch(
  ranges,
  Range.<K>lowerBoundFn(),
  range.upperBound,
  KeyPresentBehavior.ANY_PRESENT,

代码示例来源:origin: wildfly/wildfly

SortedLists.binarySearch(
  ranges,
  Range.<C>lowerBoundFn(),
  range.upperBound,
  KeyPresentBehavior.FIRST_PRESENT,

代码示例来源:origin: wildfly/wildfly

SortedLists.binarySearch(
  ranges,
  Range.<K>lowerBoundFn(),
  range.upperBound,
  KeyPresentBehavior.ANY_PRESENT,

代码示例来源:origin: org.hudsonci.lib.guava/guava

@Override
@Nullable
public V get(K key) {
 int index = SortedLists.binarySearch(ranges, Range.<K>lowerBoundFn(),
   Cut.belowValue(key), KeyPresentBehavior.ANY_PRESENT, KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? values.get(index) : null;
 }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
@Nullable
public V get(K key) {
 int index = SortedLists.binarySearch(ranges, Range.<K>lowerBoundFn(),
   Cut.belowValue(key), KeyPresentBehavior.ANY_PRESENT, KeyAbsentBehavior.NEXT_LOWER);
 if (index == -1) {
  return null;
 } else {
  Range<K> range = ranges.get(index);
  return range.contains(key) ? values.get(index) : null;
 }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public boolean encloses(Range<C> otherRange) {
 int index = SortedLists.binarySearch(ranges,
   Range.<C>lowerBoundFn(),
   otherRange.lowerBound,
   Ordering.natural(),
   ANY_PRESENT,
   NEXT_LOWER);
 return index != -1 && ranges.get(index).encloses(otherRange);
}

相关文章