All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class collections.LinkedList

java.lang.Object
   |
   +----collections.UpdatableImpl
           |
           +----collections.UpdatableSeqImpl
                   |
                   +----collections.LinkedList

public class LinkedList
extends UpdatableSeqImpl
implements UpdatableSeq, SortableCollection
LinkedList implementation. Publically implements only those methods defined in its interfaces.


Variable Index

 o list_
The head of the list.

Constructor Index

 o LinkedList()
Create a new empty list
 o LinkedList(Predicate)
Create a list with a given element screener
 o LinkedList(Predicate, LLCell, int)
Special version of constructor needed by clone()

Method Index

 o appendElements(Enumeration)
Implements collections.UpdatableSeq.appendElements.
 o at(int)
Implements collections.Seq.at.
 o checkImplementation()
Implements collections.ImplementationCheckable.checkImplementation.
 o clear()
Implements collections.UpdatableCollection.clear.
 o clone()
Build an independent copy of the list.
 o elements()
Implements collections.Collection.elements.
 o exclude(Object)
Implements collections.UpdatableCollection.exclude.
 o first()
Implements collections.Seq.first.
 o firstIndexOf(Object)
Implements collections.Seq.firstIndexOf.
 o firstIndexOf(Object, int)
Implements collections.Seq.firstIndexOf.
 o includes(Object)
Implements collections.Collection.includes.
 o insertAt(int, Object)
Implements collections.UpdatableSeq.insertAt.
 o insertElementsAt(int, Enumeration)
Implements collections.UpdatableSeq.insertElementsAt.
 o insertFirst(Object)
Implements collections.UpdatableSeq.insertFirst.
 o insertLast(Object)
Implements collections.UpdatableSeq.insertLast.
 o last()
Implements collections.Seq.last.
 o lastIndexOf(Object)
Implements collections.Seq.lastIndexOf.
 o lastIndexOf(Object, int)
Implements collections.Seq.lastIndexOf.
 o occurrencesOf(Object)
Implements collections.Collection.occurrencesOf.
 o prependElements(Enumeration)
Implements collections.UpdatableSeq.prependElements.
 o removeAt(int)
Implements collections.UpdatableSeq.removeAt.
 o removeFirst()
Implements collections.UpdatableSeq.removeFirst.
 o removeFromTo(int, int)
Implements collections.UpdatableSeq.removeFromTo.
 o removeLast()
Implements collections.UpdatableSeq.removeLast.
 o removeOneOf(Object)
Implements collections.UpdatableCollection.removeOneOf.
 o replaceAllOf(Object, Object)
Implements collections.UpdatableCollection.replaceAllOf.
 o replaceAt(int, Object)
Implements collections.UpdatableSeq.replaceAt.
 o replaceFirst(Object)
Implements collections.UpdatableSeq.replaceFirst.
 o replaceLast(Object)
Implements collections.UpdatableSeq.replaceLast.
 o replaceOneOf(Object, Object)
Implements collections.UpdatableCollection.replaceOneOf Time complexity: O(n).
 o sort(Comparator)
Implements collections.SortableCollection.sort.
 o subseq(int, int)
Implements collections.Seq.subseq.
 o take()
Implements collections.UpdatableCollection.take.

Variables

 o list_
 protected LLCell list_
The head of the list. Null iff count_ == 0

Constructors

 o LinkedList
 public LinkedList()
Create a new empty list

 o LinkedList
 public LinkedList(Predicate screener)
Create a list with a given element screener

 o LinkedList
 protected LinkedList(Predicate s,
                      LLCell l,
                      int c)
Special version of constructor needed by clone()

Methods

 o clone
 protected Object clone() throws CloneNotSupportedException
Build an independent copy of the list. The elements themselves are not cloned

Overrides:
clone in class Object
 o includes
 public synchronized boolean includes(Object element)
Implements collections.Collection.includes. Time complexity: O(n).

Overrides:
includes in class UpdatableImpl
See Also:
includes
 o occurrencesOf
 public synchronized int occurrencesOf(Object element)
Implements collections.Collection.occurrencesOf. Time complexity: O(n).

Overrides:
occurrencesOf in class UpdatableImpl
See Also:
occurrencesOf
 o elements
 public synchronized CollectionEnumeration elements()
Implements collections.Collection.elements. Time complexity: O(1).

Overrides:
elements in class UpdatableImpl
See Also:
elements
 o first
 public synchronized Object first() throws NoSuchElementException
Implements collections.Seq.first. Time complexity: O(1).

Overrides:
first in class UpdatableSeqImpl
See Also:
first
 o last
 public synchronized Object last() throws NoSuchElementException
Implements collections.Seq.last. Time complexity: O(n).

Overrides:
last in class UpdatableSeqImpl
See Also:
last
 o at
 public synchronized Object at(int index) throws NoSuchElementException
Implements collections.Seq.at. Time complexity: O(n).

Overrides:
at in class UpdatableSeqImpl
See Also:
at
 o firstIndexOf
 public synchronized int firstIndexOf(Object element,
                                      int startingIndex)
Implements collections.Seq.firstIndexOf. Time complexity: O(n).

Overrides:
firstIndexOf in class UpdatableSeqImpl
See Also:
firstIndexOf
 o firstIndexOf
 public synchronized int firstIndexOf(Object element)
Implements collections.Seq.firstIndexOf. Time complexity: O(n).

Overrides:
firstIndexOf in class UpdatableSeqImpl
See Also:
firstIndexOf
 o lastIndexOf
 public synchronized int lastIndexOf(Object element,
                                     int startingIndex)
Implements collections.Seq.lastIndexOf. Time complexity: O(n).

Overrides:
lastIndexOf in class UpdatableSeqImpl
See Also:
lastIndexOf
 o lastIndexOf
 public synchronized int lastIndexOf(Object element)
Implements collections.Seq.lastIndexOf. Time complexity: O(n).

Overrides:
lastIndexOf in class UpdatableSeqImpl
See Also:
lastIndexOf
 o subseq
 public synchronized Seq subseq(int from,
                                int length) throws NoSuchElementException
Implements collections.Seq.subseq. Time complexity: O(length).

Overrides:
subseq in class UpdatableSeqImpl
See Also:
subseq
 o clear
 public synchronized void clear()
Implements collections.UpdatableCollection.clear. Time complexity: O(1).

Overrides:
clear in class UpdatableImpl
See Also:
clear
 o exclude
 public synchronized void exclude(Object element)
Implements collections.UpdatableCollection.exclude. Time complexity: O(n).

Overrides:
exclude in class UpdatableImpl
See Also:
exclude
 o removeOneOf
 public synchronized void removeOneOf(Object element)
Implements collections.UpdatableCollection.removeOneOf. Time complexity: O(n).

Overrides:
removeOneOf in class UpdatableImpl
See Also:
removeOneOf
 o replaceOneOf
 public synchronized void replaceOneOf(Object oldElement,
                                       Object newElement) throws IllegalElementException
Implements collections.UpdatableCollection.replaceOneOf Time complexity: O(n).

Overrides:
replaceOneOf in class UpdatableImpl
See Also:
replaceOneOf
 o replaceAllOf
 public synchronized void replaceAllOf(Object oldElement,
                                       Object newElement) throws IllegalElementException
Implements collections.UpdatableCollection.replaceAllOf. Time complexity: O(n).

Overrides:
replaceAllOf in class UpdatableImpl
See Also:
replaceAllOf
 o take
 public synchronized Object take() throws NoSuchElementException
Implements collections.UpdatableCollection.take. Time complexity: O(1). takes the first element on the list

Overrides:
take in class UpdatableImpl
See Also:
take
 o sort
 public synchronized void sort(Comparator cmp)
Implements collections.SortableCollection.sort. Time complexity: O(n log n). Uses a merge-sort-based algorithm.

See Also:
sort
 o insertFirst
 public synchronized void insertFirst(Object element) throws IllegalElementException
Implements collections.UpdatableSeq.insertFirst. Time complexity: O(1).

Overrides:
insertFirst in class UpdatableSeqImpl
See Also:
insertFirst
 o replaceFirst
 public synchronized void replaceFirst(Object element) throws IllegalElementException
Implements collections.UpdatableSeq.replaceFirst. Time complexity: O(1).

Overrides:
replaceFirst in class UpdatableSeqImpl
See Also:
replaceFirst
 o removeFirst
 public synchronized void removeFirst() throws NoSuchElementException
Implements collections.UpdatableSeq.removeFirst. Time complexity: O(1).

Overrides:
removeFirst in class UpdatableSeqImpl
See Also:
removeFirst
 o insertLast
 public synchronized void insertLast(Object element) throws IllegalElementException
Implements collections.UpdatableSeq.insertLast. Time complexity: O(n).

Overrides:
insertLast in class UpdatableSeqImpl
See Also:
insertLast
 o replaceLast
 public synchronized void replaceLast(Object element) throws IllegalElementException, NoSuchElementException
Implements collections.UpdatableSeq.replaceLast. Time complexity: O(n).

Overrides:
replaceLast in class UpdatableSeqImpl
See Also:
replaceLast
 o removeLast
 public synchronized void removeLast() throws NoSuchElementException
Implements collections.UpdatableSeq.removeLast. Time complexity: O(n).

Overrides:
removeLast in class UpdatableSeqImpl
See Also:
removeLast
 o insertAt
 public synchronized void insertAt(int index,
                                   Object element) throws IllegalElementException, NoSuchElementException
Implements collections.UpdatableSeq.insertAt. Time complexity: O(n).

Overrides:
insertAt in class UpdatableSeqImpl
See Also:
insertAt
 o removeAt
 public synchronized void removeAt(int index) throws NoSuchElementException
Implements collections.UpdatableSeq.removeAt. Time complexity: O(n).

Overrides:
removeAt in class UpdatableSeqImpl
See Also:
removeAt
 o replaceAt
 public synchronized void replaceAt(int index,
                                    Object element) throws IllegalElementException, NoSuchElementException
Implements collections.UpdatableSeq.replaceAt. Time complexity: O(n).

Overrides:
replaceAt in class UpdatableSeqImpl
See Also:
replaceAt
 o prependElements
 public synchronized void prependElements(Enumeration e) throws IllegalElementException, CorruptedEnumerationException
Implements collections.UpdatableSeq.prependElements. Time complexity: O(number of elements in e).

Overrides:
prependElements in class UpdatableSeqImpl
See Also:
prependElements
 o appendElements
 public synchronized void appendElements(Enumeration e) throws IllegalElementException, CorruptedEnumerationException
Implements collections.UpdatableSeq.appendElements. Time complexity: O(n + number of elements in e).

Overrides:
appendElements in class UpdatableSeqImpl
See Also:
appendElements
 o insertElementsAt
 public synchronized void insertElementsAt(int index,
                                           Enumeration e) throws IllegalElementException, CorruptedEnumerationException, NoSuchElementException
Implements collections.UpdatableSeq.insertElementsAt. Time complexity: O(n + number of elements in e).

Overrides:
insertElementsAt in class UpdatableSeqImpl
See Also:
insertElementsAt
 o removeFromTo
 public synchronized void removeFromTo(int fromIndex,
                                       int toIndex) throws NoSuchElementException
Implements collections.UpdatableSeq.removeFromTo. Time complexity: O(n).

Overrides:
removeFromTo in class UpdatableSeqImpl
See Also:
removeFromTo
 o checkImplementation
 public synchronized void checkImplementation() throws ImplementationError
Implements collections.ImplementationCheckable.checkImplementation.

Overrides:
checkImplementation in class UpdatableImpl
See Also:
checkImplementation

All Packages  Class Hierarchy  This Package  Previous  Next  Index