本文整理了Java中org.apache.calcite.util.Util.intersects()
方法的一些代码示例,展示了Util.intersects()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.intersects()
方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:intersects
[英]Returns whether two collections have any elements in common.
[中]返回两个集合是否有任何共同元素。
代码示例来源:origin: Qihoo360/Quicksql
/** Unit test for
* {@link Util#intersects(java.util.Collection, java.util.Collection)}. */
@Test public void testIntersects() {
final List<String> empty = Collections.emptyList();
final List<String> listA = Collections.singletonList("a");
final List<String> listC = Collections.singletonList("c");
final List<String> listD = Collections.singletonList("d");
final List<String> listAbc = Arrays.asList("a", "b", "c");
assertThat(Util.intersects(empty, listA), is(false));
assertThat(Util.intersects(empty, empty), is(false));
assertThat(Util.intersects(listA, listAbc), is(true));
assertThat(Util.intersects(listAbc, listAbc), is(true));
assertThat(Util.intersects(listAbc, listC), is(true));
assertThat(Util.intersects(listAbc, listD), is(false));
assertThat(Util.intersects(listC, listD), is(false));
}
代码示例来源:origin: org.apache.calcite/calcite-core
/** Unit test for
* {@link Util#intersects(java.util.Collection, java.util.Collection)}. */
@Test public void testIntersects() {
final List<String> empty = Collections.emptyList();
final List<String> listA = Collections.singletonList("a");
final List<String> listC = Collections.singletonList("c");
final List<String> listD = Collections.singletonList("d");
final List<String> listAbc = Arrays.asList("a", "b", "c");
assertThat(Util.intersects(empty, listA), is(false));
assertThat(Util.intersects(empty, empty), is(false));
assertThat(Util.intersects(listA, listAbc), is(true));
assertThat(Util.intersects(listAbc, listAbc), is(true));
assertThat(Util.intersects(listAbc, listC), is(true));
assertThat(Util.intersects(listAbc, listD), is(false));
assertThat(Util.intersects(listC, listD), is(false));
}
内容来源于网络,如有侵权,请联系作者删除!