io.vavr.collection.List.pop2()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(104)

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

List.pop2介绍

[英]Removes the head element from this List.
[中]从此列表中删除head元素。

代码示例

代码示例来源:origin: vavr-io/vavr

@Override
public T getNext() {
  final Tuple2<Node<T>, ? extends List<Node<T>>> result = stack.pop2();
  final Node<T> node = result._1;
  stack = node.right.isEmpty() ? result._2 : pushLeftChildren(result._2, (Node<T>) node.right);
  return result._1.value;
}

代码示例来源:origin: nikhilnanivadekar/CollectionsCompare

public Card dealOneCard(List<Card> stack)
{
  Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2();
  stack = cardTuple2._2();
  return cardTuple2._1();
}

代码示例来源:origin: io.vavr/vavr

@Override
public T getNext() {
  final Tuple2<Node<T>, ? extends List<Node<T>>> result = stack.pop2();
  final Node<T> node = result._1;
  stack = node.right.isEmpty() ? result._2 : pushLeftChildren(result._2, (Node<T>) node.right);
  return result._1.value;
}

代码示例来源:origin: nikhilnanivadekar/CollectionsCompare

public Card dealOneCard(List<Card> stack)
{
  Tuple2<Card, List<Card>> cardTuple2 = stack.pop2();
  stack = cardTuple2._2();
  return cardTuple2._1();
}

代码示例来源:origin: BNYMellon/CodeKatas

public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count)
{
  var hand = HashSet.<Card>empty();
  for (int i = 0; i < count; i++)
  {
    var cardTuple2 = stack.pop2();
    stack = cardTuple2._2();
    hand = hand.add(cardTuple2._1());
  }
  return Tuple.of(hand, stack);
}

代码示例来源:origin: BNYMellon/CodeKatas

public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count)
{
  Set<Card> hand = HashSet.empty();
  for (int i = 0; i < count; i++)
  {
    Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2();
    stack = cardTuple2._2();
    hand = hand.add(cardTuple2._1());
  }
  return Tuple.of(hand, stack);
}

代码示例来源:origin: nikhilnanivadekar/CollectionsCompare

public Tuple2<Set<Card>, List<Card>> deal(List<Card> stack, int count)
{
  Set<Card> hand = HashSet.empty();
  for (int i = 0; i < count; i++)
  {
    Tuple2<Card, List<Card>> cardTuple2 = stack.pop2();
    stack = cardTuple2._2();
    hand = hand.add(cardTuple2._1());
  }
  return Tuple.of(hand, stack);
}

代码示例来源:origin: nikhilnanivadekar/CollectionsCompare

public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count)
{
  Set<Card> hand = HashSet.empty();
  for (int i = 0; i < count; i++)
  {
    Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2();
    stack = cardTuple2._2();
    hand = hand.add(cardTuple2._1());
  }
  return Tuple.of(hand, stack);
}

相关文章