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

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

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

ReactiveSeq.subStream介绍

[英]Return a Stream with elements before the provided skip index removed, and elements after the provided take index removed

ReactiveSeq.of(1,2,3,4,5,6).subStream(1,3);

[中]返回一个流,其中删除了提供的跳过索引之前的元素,删除了提供的获取索引之后的元素

ReactiveSeq.of(1,2,3,4,5,6).subStream(1,3);

代码示例

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

/**
 * Return a Streamable with elements before the provided skip index removed, and elements after the provided
 * take index removed
 *
 * <pre>
 * {@code
 *   Streamable.of(1,2,3,4,5,6).subStream(1,3);
 *
 *
 *   //Streamable[2,3]
 * }
 * </pre>
 *
 * @param start index inclusive
 * @param end index exclusive
 * @return Sequence between supplied indexes of original Sequence
 */
default Streamable<T> subStream(final int start, final int end) {
  return Streamable.fromStream(this.stream().subStream(start, end));
}

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

@Test
public void subStream(){
  List<Integer> list = of(1,2,3,4,5,6).subStream(1,3).toList();
  assertThat(list,equalTo(Arrays.asList(2,3)));
}
@Test

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

@Test
public void subStream(){
  List<Integer> list = of(1,2,3,4,5,6).subStream(1,3).toList();
  assertThat(list,equalTo(Arrays.asList(2,3)));
}
@Test

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

@Test
public void subStream(){
  List<Integer> list = Spouts.of(1,2,3,4,5,6).subStream(1,3).toList();
  assertThat(list,equalTo(Arrays.asList(2,3)));
}
@Test

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

@Test
public void subStream(){
  List<Integer> list = Spouts.of(1,2,3,4,5,6).subStream(1,3).toList();
  assertThat(list,equalTo(Arrays.asList(2,3)));
}
@Test

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

@Test
public void subStream(){
  List<Integer> list = of(1,2,3,4,5,6).subStream(1,3).toList();
  assertThat(list,equalTo(Arrays.asList(2,3)));
}
@Test

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

@Test
public void subStream(){
  List<Integer> list = ReactiveSeq.of(1,2,3,4,5,6).subStream(1,3).toList();
  assertThat(list,equalTo(Arrays.asList(2,3)));
}
@Test

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

/**
 * Return a Streamable with elements before the provided skip index removed, and elements after the provided
 * take index removed
 *
 * <pre>
 * {@code
 *   Streamable.of(1,2,3,4,5,6).subStream(1,3);
 *
 *
 *   //Streamable[2,3]
 * }
 * </pre>
 *
 * @param start index inclusive
 * @param end index exclusive
 * @return Sequence between supplied indexes of original Sequence
 */
default Streamable<T> subStream(final int start, final int end) {
  return Streamable.fromStream(this.stream().subStream(start, end));
}

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

/**
 * Return a Stream with elements before the provided skip index removed, and elements after the provided
 * take index removed
 *
 * <pre>
 * {@code
 *   FutureStream.of(1,2,3,4,5,6).subStream(1,3);
 *
 *
 *   //FutureStream[2,3]
 * }
 * </pre>
 *
 * @param start index inclusive
 * @param end index exclusive
 * @return LqzyFutureStream between supplied indexes of original Sequence
 */
@Override
default FutureStream<U> subStream(final int start, final int end) {
  return this.fromStream(ReactiveSeq.oneShotStream(stream())
                   .subStream(start, end));
}

相关文章

微信公众号

最新文章

更多

ReactiveSeq类方法