edu.neu.ccs.quick
Class QuickLinkedList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.AbstractSequentialList
              extended byjava.util.LinkedList
                  extended byedu.neu.ccs.quick.QuickLinkedList
All Implemented Interfaces:
Cloneable, Collection, List, Serializable

public class QuickLinkedList
extends LinkedList

QuickLinkedList extends LinkedList by adding one constructor and three methods addItems, setItems, and removeItems that handle an array of Object at once.

All constructors of the original LinkedList class are provided as well.

No changes are made to the internal data structure or to any inherited methods.

Since:
2.3
Version:
2.3
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.LinkedList
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
 
Fields inherited from class java.util.LinkedList
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
QuickLinkedList()
          A constructor that delegates to class LinkedList.
QuickLinkedList(Collection c)
          A constructor that delegates to class LinkedList.
QuickLinkedList(Object[] items)
          Constructor that adds the given array of items one-by-one to the linked list.
 
Method Summary
 void addItems(Object[] items)
          Method that adds the given array of items one-by-one to the linked list.
 void removeItems(Object[] items)
          Method that removes the given array of items one-by-one from the linked list.
 void setItems(Object[] items)
          Method that first clears this linked list of any existing items and then adds the given array of items one-by-one to the linked list.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

QuickLinkedList

public QuickLinkedList()
A constructor that delegates to class LinkedList.


QuickLinkedList

public QuickLinkedList(Collection c)
A constructor that delegates to class LinkedList.


QuickLinkedList

public QuickLinkedList(Object[] items)

Constructor that adds the given array of items one-by-one to the linked list.

Parameters:
items - the array of items to add to this linked list
See Also:
addItems(Object[])
Method Detail

addItems

public void addItems(Object[] items)

Method that adds the given array of items one-by-one to the linked list.

If items is null, then does nothing.

Parameters:
items - the array of items to add to this linked list
See Also:
QuickLinkedList(Object[]), setItems(Object[]), removeItems(Object[])

setItems

public void setItems(Object[] items)

Method that first clears this linked list of any existing items and then adds the given array of items one-by-one to the linked list.

If items is null, then this method is equivalent to the inherited method clear.

Parameters:
items - the array of items to add to this linked list after clearance
See Also:
addItems(Object[]), removeItems(Object[])

removeItems

public void removeItems(Object[] items)

Method that removes the given array of items one-by-one from the linked list.

If items is null, then does nothing.

Parameters:
items - the array of items to remove from this linked list
See Also:
addItems(Object[]), setItems(Object[])