org.jsoup.helper
Class DescendableLinkedList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<E>
                  extended by org.jsoup.helper.DescendableLinkedList<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Deque<E>, List<E>, Queue<E>

public class DescendableLinkedList<E>
extends LinkedList<E>

Provides a descending iterator and other 1.6 methods to allow support on the 1.5 JRE.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DescendableLinkedList()
          Create a new DescendableLinkedList.
 
Method Summary
 Iterator<E> descendingIterator()
          Get an iterator that starts and the end of the list and works towards the start.
 E peekLast()
          Look at the last element, if there is one.
 E pollLast()
          Remove and return the last element, if there is one
 void push(E e)
          Add a new element to the start of the list.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, poll, pollFirst, pop, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, 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
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

DescendableLinkedList

public DescendableLinkedList()
Create a new DescendableLinkedList.

Method Detail

push

public void push(E e)
Add a new element to the start of the list.

Specified by:
push in interface Deque<E>
Overrides:
push in class LinkedList<E>
Parameters:
e - element to add

peekLast

public E peekLast()
Look at the last element, if there is one.

Specified by:
peekLast in interface Deque<E>
Overrides:
peekLast in class LinkedList<E>
Returns:
the last element, or null

pollLast

public E pollLast()
Remove and return the last element, if there is one

Specified by:
pollLast in interface Deque<E>
Overrides:
pollLast in class LinkedList<E>
Returns:
the last element, or null

descendingIterator

public Iterator<E> descendingIterator()
Get an iterator that starts and the end of the list and works towards the start.

Specified by:
descendingIterator in interface Deque<E>
Overrides:
descendingIterator in class LinkedList<E>
Returns:
an iterator that starts and the end of the list and works towards the start.


Copyright © 2009-2011 Jonathan Hedley. All Rights Reserved.