本文整理了Java中cyclops.reactive.ReactiveSeq.dropRight
方法的一些代码示例,展示了ReactiveSeq.dropRight
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReactiveSeq.dropRight
方法的具体详情如下:
包路径:cyclops.reactive.ReactiveSeq
类名称: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
内容来源于网络,如有侵权,请联系作者删除!