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:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Deque<E>, java.util.List<E>, java.util.Queue<E>

public class DescendableLinkedList<E>
extends java.util.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
 java.util.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 java.util.Deque<E>
Overrides:
push in class java.util.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 java.util.Deque<E>
Overrides:
peekLast in class java.util.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 java.util.Deque<E>
Overrides:
pollLast in class java.util.LinkedList<E>
Returns:
the last element, or null

descendingIterator

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

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


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