本文整理了Java中org.apache.edgent.function.Functions.zero()
方法的一些代码示例,展示了Functions.zero()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Functions.zero()
方法的具体详情如下:
包路径:org.apache.edgent.function.Functions
类名称:Functions
方法名:zero
[英]Returns a constant function that returns zero (0).
[中]返回一个返回零(0)的常量函数。
代码示例来源:origin: org.apache.edgent/edgent-api-function
/**
* Returns a constant function that returns zero (0).
* This is identical to {@link #zero()} but is more
* readable when applied as a key function.
* @param <T> tuple type
* @return Constant function that returns zero (0).
*/
public static <T> Function<T,Integer> unpartitioned() {
return zero();
}
代码示例来源:origin: apache/incubator-edgent
/**
* Returns a constant function that returns zero (0).
* This is identical to {@link #zero()} but is more
* readable when applied as a key function.
* @param <T> tuple type
* @return Constant function that returns zero (0).
*/
public static <T> Function<T,Integer> unpartitioned() {
return zero();
}
代码示例来源:origin: apache/incubator-edgent
@Test
public void testZero() {
String s = "hello";
assertEquals(Integer.valueOf(0), zero().apply(s));
Integer i = 42;
assertEquals(Integer.valueOf(0), zero().apply(i));
Object o = new Object();
assertEquals(Integer.valueOf(0), zero().apply(o));
}
@Test
代码示例来源:origin: apache/incubator-edgent
assertSame(zero(), window.getKeyFunction());
TStream<Long> diffStream = window.aggregate((tuples, key) -> {
assertEquals(Integer.valueOf(0), key);
内容来源于网络,如有侵权,请联系作者删除!