|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractList java.util.AbstractSequentialList edu.emory.mathcs.backport.java.util.LinkedList
Constructor Summary | |
LinkedList()
|
|
LinkedList(java.util.Collection c)
|
Method Summary | |
void |
add(int index,
java.lang.Object element)
|
boolean |
add(java.lang.Object o)
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available. |
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
void |
addFirst(java.lang.Object e)
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions. |
void |
addLast(java.lang.Object e)
Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions. |
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object o)
Returns true if this deque contains the specified element. |
java.util.Iterator |
descendingIterator()
Returns an iterator over the elements in this deque in reverse sequential order. |
java.lang.Object |
element()
Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque). |
java.lang.Object |
get(int index)
|
java.lang.Object |
getFirst()
Retrieves, but does not remove, the first element of this deque. |
java.lang.Object |
getLast()
Retrieves, but does not remove, the last element of this deque. |
int |
indexOf(java.lang.Object o)
|
boolean |
isEmpty()
|
int |
lastIndexOf(java.lang.Object o)
|
java.util.ListIterator |
listIterator()
|
java.util.ListIterator |
listIterator(int index)
|
boolean |
offer(java.lang.Object e)
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available. |
boolean |
offerFirst(java.lang.Object e)
Inserts the specified element at the front of this deque unless it would violate capacity restrictions. |
boolean |
offerLast(java.lang.Object e)
Inserts the specified element at the end of this deque unless it would violate capacity restrictions. |
java.lang.Object |
peek()
Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty. |
java.lang.Object |
peekFirst()
Retrieves, but does not remove, the first element of this deque, or returns null if this deque is empty. |
java.lang.Object |
peekLast()
Retrieves, but does not remove, the last element of this deque, or returns null if this deque is empty. |
java.lang.Object |
poll()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty. |
java.lang.Object |
pollFirst()
Retrieves and removes the first element of this deque, or returns null if this deque is empty. |
java.lang.Object |
pollLast()
Retrieves and removes the last element of this deque, or returns null if this deque is empty. |
java.lang.Object |
pop()
Pops an element from the stack represented by this deque. |
void |
push(java.lang.Object e)
Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available. |
java.lang.Object |
remove()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque). |
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object o)
Removes the first occurrence of the specified element from this deque. |
java.lang.Object |
removeFirst()
Retrieves and removes the first element of this deque. |
boolean |
removeFirstOccurrence(java.lang.Object o)
Removes the first occurrence of the specified element from this deque. |
java.lang.Object |
removeLast()
Retrieves and removes the last element of this deque. |
boolean |
removeLastOccurrence(java.lang.Object o)
Removes the last occurrence of the specified element from this deque. |
java.lang.Object |
set(int index,
java.lang.Object element)
|
int |
size()
Returns the number of elements in this deque. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
Methods inherited from class java.util.AbstractSequentialList |
iterator |
Methods inherited from class java.util.AbstractList |
equals, hashCode, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, 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, iterator, removeAll, retainAll, subList |
Methods inherited from interface edu.emory.mathcs.backport.java.util.Deque |
iterator |
Constructor Detail |
public LinkedList()
public LinkedList(java.util.Collection c)
Method Detail |
public int size()
Deque
size
in interface java.util.List
public boolean isEmpty()
isEmpty
in interface java.util.List
public boolean contains(java.lang.Object o)
Deque
contains
in interface java.util.List
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.List
public boolean add(java.lang.Object o)
Deque
offer
.
This method is equivalent to Deque.addLast(java.lang.Object)
.
add
in interface java.util.List
public boolean remove(java.lang.Object o)
Deque
This method is equivalent to Deque.removeFirstOccurrence(java.lang.Object)
.
remove
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.List
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
public void clear()
clear
in interface java.util.List
public java.lang.Object get(int index)
get
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
public void add(int index, java.lang.Object element)
add
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
public void addFirst(java.lang.Object e)
Deque
Deque.offerFirst(java.lang.Object)
.
addFirst
in interface Deque
e
- the element to addpublic void addLast(java.lang.Object e)
Deque
Deque.offerLast(java.lang.Object)
.
This method is equivalent to Deque.add(java.lang.Object)
.
addLast
in interface Deque
e
- the element to addpublic boolean offerFirst(java.lang.Object e)
Deque
Deque.addFirst(java.lang.Object)
method,
which can fail to insert an element only by throwing an exception.
offerFirst
in interface Deque
e
- the element to add
public boolean offerLast(java.lang.Object e)
Deque
Deque.addLast(java.lang.Object)
method,
which can fail to insert an element only by throwing an exception.
offerLast
in interface Deque
e
- the element to add
public java.lang.Object removeFirst()
Deque
pollFirst
only in that it throws an
exception if this deque is empty.
removeFirst
in interface Deque
public java.lang.Object removeLast()
Deque
pollLast
only in that it throws an
exception if this deque is empty.
removeLast
in interface Deque
public java.lang.Object pollFirst()
Deque
pollFirst
in interface Deque
public java.lang.Object pollLast()
Deque
pollLast
in interface Deque
public java.lang.Object getFirst()
Deque
peekFirst
only in that it
throws an exception if this deque is empty.
getFirst
in interface Deque
public java.lang.Object getLast()
Deque
peekLast
only in that it
throws an exception if this deque is empty.
getLast
in interface Deque
public java.lang.Object peekFirst()
Deque
peekFirst
in interface Deque
public java.lang.Object peekLast()
Deque
peekLast
in interface Deque
public boolean removeFirstOccurrence(java.lang.Object o)
Deque
removeFirstOccurrence
in interface Deque
o
- element to be removed from this deque, if present
public boolean removeLastOccurrence(java.lang.Object o)
Deque
removeLastOccurrence
in interface Deque
o
- element to be removed from this deque, if present
public boolean offer(java.lang.Object e)
Deque
Deque.add(java.lang.Object)
method, which can fail to
insert an element only by throwing an exception.
This method is equivalent to Deque.offerLast(java.lang.Object)
.
offer
in interface Deque
e
- the element to add
public java.lang.Object remove()
Deque
poll
only in that it throws an
exception if this deque is empty.
This method is equivalent to Deque.removeFirst()
.
remove
in interface Deque
public java.lang.Object poll()
Deque
This method is equivalent to Deque.pollFirst()
.
poll
in interface Deque
public java.lang.Object element()
Deque
peek
only in that it throws an
exception if this deque is empty.
This method is equivalent to Deque.getFirst()
.
element
in interface Deque
public java.lang.Object peek()
Deque
This method is equivalent to Deque.peekFirst()
.
peek
in interface Deque
public void push(java.lang.Object e)
Deque
This method is equivalent to Deque.addFirst(java.lang.Object)
.
push
in interface Deque
e
- the element to pushpublic java.lang.Object pop()
Deque
This method is equivalent to Deque.removeFirst()
.
pop
in interface Deque
public java.util.Iterator descendingIterator()
Deque
descendingIterator
in interface Deque
public java.lang.Object clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |