cyclops.reactive.ReactiveSeq.xMatch()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(103)

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

ReactiveSeq.xMatch介绍

[英]Check that there are specified number of matches of predicate in the Stream

assertTrue(ReactiveSeq.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));

[中]检查流中是否有指定数量的谓词匹配

assertTrue(ReactiveSeq.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));

代码示例

代码示例来源:origin: aol/cyclops

/**
 * Check that there are specified number of matches of predicate in the Stream
 *
 * <pre>
 * {@code
 *  assertTrue(Streamable.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
 * }
 * </pre>
 *
 */
@Override
default boolean xMatch(final int num, final Predicate<? super T> c) {
  return this.stream().xMatch(num, c);
}

代码示例来源:origin: aol/cyclops

/**
   * Check that there are specified number of matches of predicate in the
   * Stream
   *
   * <pre>
   * {@code
   *  assertTrue(ReactiveSeq.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
   * }
   * </pre>
   *
   */
  default boolean xMatch(final int num, final Predicate<? super T> c) {
    return stream().xMatch(num, c);
  }
}

代码示例来源:origin: aol/cyclops

@SafeVarargs
public static <T1> Predicate<? super T1> xOf(final int x, final Predicate<? super T1>... preds) {
  return test -> ReactiveSeq.of(preds)
               .map(t -> t.test(test))
               .xMatch(x, r -> r);
}

代码示例来源:origin: aol/cyclops

@Test
public void xMatch(){
  assertTrue(Spouts.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
}

代码示例来源:origin: aol/cyclops

@Test
public void xMatch(){
  assertTrue(of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
}

代码示例来源:origin: aol/cyclops

@Test
public void xMatch(){
  assertTrue(of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
}

代码示例来源:origin: aol/cyclops

@Test
public void xMatch(){
  assertTrue(ReactiveSeq.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
}

代码示例来源:origin: aol/cyclops

@Test
public void xMatch(){
  assertTrue(of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
}

代码示例来源:origin: aol/cyclops

@Test
public void xMatch(){
  assertTrue(Spouts.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
}

代码示例来源:origin: com.oath.cyclops/cyclops

/**
 * Check that there are specified number of matches of predicate in the Stream
 *
 * <pre>
 * {@code
 *  assertTrue(Streamable.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
 * }
 * </pre>
 *
 */
@Override
default boolean xMatch(final int num, final Predicate<? super T> c) {
  return this.stream().xMatch(num, c);
}

代码示例来源:origin: com.oath.cyclops/cyclops

/**
   * Check that there are specified number of matches of predicate in the
   * Stream
   *
   * <pre>
   * {@code
   *  assertTrue(ReactiveSeq.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
   * }
   * </pre>
   *
   */
  default boolean xMatch(final int num, final Predicate<? super T> c) {
    return stream().xMatch(num, c);
  }
}

代码示例来源:origin: com.oath.cyclops/cyclops

@SafeVarargs
public static <T1> Predicate<? super T1> xOf(final int x, final Predicate<? super T1>... preds) {
  return test -> ReactiveSeq.of(preds)
               .map(t -> t.test(test))
               .xMatch(x, r -> r);
}

相关文章

微信公众号

最新文章

更多

ReactiveSeq类方法