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

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

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

ReactiveSeq.dropRight介绍

暂无

代码示例

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

@Override
default ImmutableList<T> dropRight(int num) {
  if(num>size())
    return emptyUnit();
  return unitStream(stream().dropRight(num));
}

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

@Test
public void testSkipLastForEach(){
  List<Integer> list = new ArrayList();
  ReactiveSeq.of(1,2,3,4,5).dropRight(2)
      .forEach(n->{list.add(n);});
  assertThat(list,equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLastForEach(){
  List<Integer> list = new ArrayList();
  ReactiveSeq.of(1,2,3,4,5).dropRight(2)
      .forEach(n->{list.add(n);});
  assertThat(list,equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLast1Empty(){
  assertThat(of()
      .dropRight(1)
      .collect(Collectors.toList()),equalTo(Arrays.asList()));
}
@Test

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

@Test
public void testSkipLastForEach(){
  List<Integer> list = new ArrayList();
  Spouts.of(1,2,3,4,5)
      .dropRight(2)
      .forEach(n->{list.add(n);});
  assertThat(list,equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLast(){
  assertThat(of(1,2,3,4,5)
      .dropRight(2)
      .collect(Collectors.toList()),equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLast(){
  assertThat(of(1,2,3,4,5)
            .dropRight(2)
            .collect(Collectors.toList()),equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLastEmpty(){
  assertThat(of()
            .dropRight(2)
            .collect(Collectors.toList()),equalTo(Arrays.asList()));
}
@Test

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

@Test
public void testSkipLast(){
  assertThat(ReactiveSeq.of(1,2,3,4,5)
            .dropRight(2)
            .collect(Collectors.toList()),equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLastEmpty(){
  assertThat(ReactiveSeq.of()
            .dropRight(2)
            .collect(Collectors.toList()),equalTo(Arrays.asList()));
}
@Test

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

@Test
public void testSkipLastEmpty(){
  assertThat(of()
            .dropRight(2)
            .collect(Collectors.toList()),equalTo(Arrays.asList()));
}
@Test

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

@Test
public void testSkipLast(){
  assertThat(Spouts.of(1,2,3,4,5)
      .dropRight(2)
      .toList(),equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void testSkipLast(){
  assertThat(ReactiveSeq.of(1,2,3,4,5)
      .dropRight(2)
      .toList(),equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void dropRightValues(){
  assertThat(of(1,2,3).dropRight(-1).seq(), Matchers.equalTo(of(1,2,3).seq()));
  assertThat(of(1,2,3).dropRight(0).seq(), Matchers.equalTo(of(1,2,3).seq()));
  assertThat(of(1,2,3).dropRight(1).seq(), Matchers.equalTo(of(1,2).seq()));
  assertThat(of(1,2,3).dropRight(2).seq(), Matchers.equalTo(of(1).seq()));
  assertThat(of(1,2,3).dropRight(3).seq(), Matchers.equalTo(of().seq()));
  assertThat(of(1,2,3).dropRight(4).seq(), Matchers.equalTo(of().seq()));
}
@Test

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

@Test
public void dropRight(){
  System.out.println(of(1,2,3).dropRight(1).toList());
  assertThat(of(1,2,3).dropRight(1).toList(),hasItems(1,2));
}
@Test

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

@Test
public void dropRightValues(){
  assertThat(of(1,2,3).dropRight(-1).seq(),equalTo(of(1,2,3).seq()));
  assertThat(of(1,2,3).dropRight(0).seq(),equalTo(of(1,2,3).seq()));
  assertThat(of(1,2,3).dropRight(1).seq(),equalTo(of(1,2).seq()));
  assertThat(of(1,2,3).dropRight(2).seq(),equalTo(of(1).seq()));
  assertThat(of(1,2,3).dropRight(3).seq(),equalTo(of().seq()));
  assertThat(of(1,2,3).dropRight(4).seq(),equalTo(of().seq()));
}
@Test

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

@Test
public void skipLast1(){
  assertThat(of(1,2,3).dropRight(1).toList(),hasItems(1,2));
}
@Test

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

@Test
public void dropRight() {
  assertThat(of(1, 2, 3).dropRight(1).toList(), hasItems(1, 2));
}

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

@Test
public void dropRight(){
  assertThat(of(1,2,3).dropRight(1).toList(),hasItems(1,2));
}
@Test

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

@Test
public void skipLast1(){
  assertThat(of(1,2,3).dropRight(1).toList(),hasItems(1,2));
}
@Test

相关文章

微信公众号

最新文章

更多

ReactiveSeq类方法