本文整理了Java中com.google.common.collect.MinMaxPriorityQueue.isEvenLevel()
方法的一些代码示例,展示了MinMaxPriorityQueue.isEvenLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MinMaxPriorityQueue.isEvenLevel()
方法的具体详情如下:
包路径:com.google.common.collect.MinMaxPriorityQueue
类名称:MinMaxPriorityQueue
方法名:isEvenLevel
暂无
代码示例来源:origin: google/guava
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: google/j2objc
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: wildfly/wildfly
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: google/guava
public void testIsEvenLevel() {
assertTrue(MinMaxPriorityQueue.isEvenLevel(0));
assertFalse(MinMaxPriorityQueue.isEvenLevel(1));
assertFalse(MinMaxPriorityQueue.isEvenLevel(2));
assertTrue(MinMaxPriorityQueue.isEvenLevel(3));
assertFalse(MinMaxPriorityQueue.isEvenLevel((1 << 10) - 2));
assertTrue(MinMaxPriorityQueue.isEvenLevel((1 << 10) - 1));
assertTrue(MinMaxPriorityQueue.isEvenLevel(i - 2));
assertFalse(MinMaxPriorityQueue.isEvenLevel(i - 1));
assertFalse(MinMaxPriorityQueue.isEvenLevel(i));
assertFalse(MinMaxPriorityQueue.isEvenLevel(i - 2));
assertTrue(MinMaxPriorityQueue.isEvenLevel(i - 1));
assertTrue(MinMaxPriorityQueue.isEvenLevel(i));
assertTrue(MinMaxPriorityQueue.isEvenLevel((1 << 31) - 2));
assertTrue(MinMaxPriorityQueue.isEvenLevel(Integer.MAX_VALUE - 1));
try {
MinMaxPriorityQueue.isEvenLevel((1 << 31) - 1);
fail("Should overflow");
} catch (IllegalStateException expected) {
MinMaxPriorityQueue.isEvenLevel(Integer.MAX_VALUE);
fail("Should overflow");
} catch (IllegalStateException expected) {
MinMaxPriorityQueue.isEvenLevel(1 << 31);
fail("Should be negative");
代码示例来源:origin: Nextdoor/bender
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: com.google.guava/guava-jdk5
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: com.diffplug.guava/guava-collect
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: org.hudsonci.lib.guava/guava
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: com.atlassian.bundles/guava
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: org.sonatype.sisu/sisu-guava
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger
private Heap heapForIndex(int i) {
return isEvenLevel(i) ? minHeap : maxHeap;
}
代码示例来源:origin: com.google.guava/guava-tests
public void testIsEvenLevel() {
assertTrue(MinMaxPriorityQueue.isEvenLevel(0));
assertFalse(MinMaxPriorityQueue.isEvenLevel(1));
assertFalse(MinMaxPriorityQueue.isEvenLevel(2));
assertTrue(MinMaxPriorityQueue.isEvenLevel(3));
assertFalse(MinMaxPriorityQueue.isEvenLevel((1 << 10) - 2));
assertTrue(MinMaxPriorityQueue.isEvenLevel((1 << 10) - 1));
assertTrue(MinMaxPriorityQueue.isEvenLevel(i - 2));
assertFalse(MinMaxPriorityQueue.isEvenLevel(i - 1));
assertFalse(MinMaxPriorityQueue.isEvenLevel(i));
assertFalse(MinMaxPriorityQueue.isEvenLevel(i - 2));
assertTrue(MinMaxPriorityQueue.isEvenLevel(i - 1));
assertTrue(MinMaxPriorityQueue.isEvenLevel(i));
assertTrue(MinMaxPriorityQueue.isEvenLevel((1 << 31) - 2));
assertTrue(MinMaxPriorityQueue.isEvenLevel(Integer.MAX_VALUE - 1));
try {
MinMaxPriorityQueue.isEvenLevel((1 << 31) - 1);
fail("Should overflow");
} catch (IllegalStateException expected) {
MinMaxPriorityQueue.isEvenLevel(Integer.MAX_VALUE);
fail("Should overflow");
} catch (IllegalStateException expected) {
MinMaxPriorityQueue.isEvenLevel(1 << 31);
fail("Should be negative");
内容来源于网络,如有侵权,请联系作者删除!