Java Iterator splice(LinkedList list, Iterator iterator, LinkedList list2, V v)

Here you can find the source of splice(LinkedList list, Iterator iterator, LinkedList list2, V v)

Description

splice

License

Open Source License

Declaration

public static <V> void splice(LinkedList<V> list, Iterator<V> iterator, LinkedList<V> list2, V v) 

Method Source Code

//package com.java2s;
/*/*from  ww w  .jav  a2 s.c  om*/
 * Copyright (C) 2009 Emweb bvba, Leuven, Belgium.
 *
 * See the LICENSE file for terms of use.
 */

import java.util.Iterator;
import java.util.LinkedList;

public class Main {
    public static <V> void splice(LinkedList<V> list, Iterator<V> iterator, LinkedList<V> list2, V v) {
        list2.remove(v);
        assert (iterator.equals(list.iterator()));

        list.addFirst(v);
    }
}

Related

  1. singletonIterator(final Object item)
  2. singletonIterator(final T item)
  3. singletonIterator(final T nullableValue)
  4. singletonIterator(final T t)
  5. size(Iterator iterator)
  6. toArray(final Iterator iterator)
  7. toCollection(final Iterator iterator, final Collection c)
  8. toCommaSeparatedString(Iterator i)
  9. toIterator(Collection col)