public boolean addAll(Collection coll) { return addAll(size, coll); }
public boolean addAll(Collection coll) { return addAll(size, coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
public boolean addAll(int index, Collection coll) { rangeCheck(index, size + 1); int cSize = coll.size(); if (cSize == 0) { return false; } checkModCount(); parent.addAll(offset + index, coll); expectedModCount = parent.modCount; size += cSize; LinkedSubList.this.modCount++; return true; }
public boolean addAll(int index, Collection coll) { rangeCheck(index, size + 1); int cSize = coll.size(); if (cSize == 0) { return false; } checkModCount(); parent.addAll(offset + index, coll); expectedModCount = parent.modCount; size += cSize; LinkedSubList.this.modCount++; return true; }
public void testRemoveLast() { resetEmpty(); AbstractLinkedList list = (AbstractLinkedList) collection; if (isRemoveSupported() == false) { try { list.removeLast(); } catch (UnsupportedOperationException ex) {} } list.addAll( Arrays.asList( new String[]{"value1", "value2"})); assertEquals( "value2", list.removeLast() ); list.addFirst( "value3"); checkNodes(); assertEquals( "value1", list.removeLast() ); assertEquals( "value3", list.removeLast() ); list.addFirst( "value4" ); checkNodes(); assertEquals( "value4", list.removeFirst() ); }
public void testRemoveFirst() { resetEmpty(); AbstractLinkedList list = (AbstractLinkedList) collection; if (isRemoveSupported() == false) { try { list.removeFirst(); } catch (UnsupportedOperationException ex) {} } list.addAll( Arrays.asList( new String[]{"value1", "value2"})); assertEquals( "value1", list.removeFirst() ); checkNodes(); list.addLast( "value3"); checkNodes(); assertEquals( "value2", list.removeFirst() ); assertEquals( "value3", list.removeFirst() ); checkNodes(); list.addLast( "value4" ); checkNodes(); assertEquals( "value4", list.removeFirst() ); checkNodes(); }
list.addAll( Arrays.asList( new String[]{"value1", "value2"})); checkNodes(); list.addFirst("value0");
public void testRemoveNode() { resetEmpty(); if (isAddSupported() == false || isRemoveSupported() == false) return; AbstractLinkedList list = (AbstractLinkedList) collection; list.addAll( Arrays.asList( new String[]{"value1", "value2"})); list.removeNode(list.getNode(0, false)); checkNodes(); assertEquals("value2", list.getFirst()); assertEquals("value2", list.getLast()); list.addFirst("value1"); list.addFirst("value0"); checkNodes(); list.removeNode(list.getNode(1, false)); assertEquals("value0", list.getFirst()); assertEquals("value2", list.getLast()); checkNodes(); list.removeNode(list.getNode(1, false)); assertEquals("value0", list.getFirst()); assertEquals("value0", list.getLast()); checkNodes(); }
public boolean addAll(Collection coll) { return addAll(size, coll); }
public boolean addAll(Collection coll) { return addAll(size, coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
/** * Constructs a list copying data from the specified collection. * * @param coll the collection to copy */ protected AbstractLinkedList(Collection coll) { super(); init(); addAll(coll); }
public boolean addAll(int index, Collection coll) { rangeCheck(index, size + 1); int cSize = coll.size(); if (cSize == 0) { return false; } checkModCount(); parent.addAll(offset + index, coll); expectedModCount = parent.modCount; size += cSize; LinkedSubList.this.modCount++; return true; }
public boolean addAll(int index, Collection coll) { rangeCheck(index, size + 1); int cSize = coll.size(); if (cSize == 0) { return false; } checkModCount(); parent.addAll(offset + index, coll); expectedModCount = parent.modCount; size += cSize; LinkedSubList.this.modCount++; return true; }
public boolean addAll(int index, Collection coll) { rangeCheck(index, size + 1); int cSize = coll.size(); if (cSize == 0) { return false; } checkModCount(); parent.addAll(offset + index, coll); expectedModCount = parent.modCount; size += cSize; LinkedSubList.this.modCount++; return true; }