|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
edu.emory.mathcs.backport.java.util.LinkedList
public class 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 Deque
size
in interface java.util.Collection
size
in interface java.util.List
size
in class java.util.AbstractCollection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
isEmpty
in class java.util.AbstractCollection
public boolean contains(java.lang.Object o)
Deque
contains
in interface Deque
contains
in interface java.util.Collection
contains
in interface java.util.List
contains
in class java.util.AbstractCollection
o
- element whose presence in this deque is to be tested
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
indexOf
in class java.util.AbstractList
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
lastIndexOf
in class java.util.AbstractList
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in class java.util.AbstractCollection
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in class java.util.AbstractCollection
public boolean add(java.lang.Object o)
Deque
offer
.
This method is equivalent to Deque.addLast(java.lang.Object)
.
add
in interface Deque
add
in interface Queue
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.AbstractList
o
- the element to add
Collection.add(java.lang.Object)
)public boolean remove(java.lang.Object o)
Deque
This method is equivalent to Deque.removeFirstOccurrence(java.lang.Object)
.
remove
in interface Deque
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.AbstractCollection
o
- element to be removed from this deque, if present
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.AbstractCollection
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.AbstractSequentialList
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.AbstractList
public java.lang.Object get(int index)
get
in interface java.util.List
get
in class java.util.AbstractSequentialList
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.AbstractSequentialList
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.AbstractSequentialList
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.AbstractSequentialList
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
listIterator
in class java.util.AbstractList
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
listIterator
in class java.util.AbstractSequentialList
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
offer
in interface Queue
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
remove
in interface Queue
public java.lang.Object poll()
Deque
This method is equivalent to Deque.pollFirst()
.
poll
in interface Deque
poll
in interface Queue
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
element
in interface Queue
public java.lang.Object peek()
Deque
This method is equivalent to Deque.peekFirst()
.
peek
in interface Deque
peek
in interface Queue
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()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |