Package org.onlab.util
Class UnmodifiableDeque<E>
- java.lang.Object
-
- org.onlab.util.UnmodifiableDeque<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Deque<E>
,java.util.Queue<E>
public class UnmodifiableDeque<E> extends java.lang.Object implements java.util.Deque<E>
Unmodifiable view of the specified Deque.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
void
addFirst(E e)
void
addLast(E e)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
java.util.Iterator<E>
descendingIterator()
E
element()
boolean
equals(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super E> action)
E
getFirst()
E
getLast()
int
hashCode()
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
offer(E e)
boolean
offerFirst(E e)
boolean
offerLast(E e)
java.util.stream.Stream<E>
parallelStream()
E
peek()
E
peekFirst()
E
peekLast()
E
poll()
E
pollFirst()
E
pollLast()
E
pop()
void
push(E e)
E
remove()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
E
removeFirst()
boolean
removeFirstOccurrence(java.lang.Object o)
boolean
removeIf(java.util.function.Predicate<? super E> filter)
E
removeLast()
boolean
removeLastOccurrence(java.lang.Object o)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.util.Spliterator<E>
spliterator()
java.util.stream.Stream<E>
stream()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
static <T> java.util.Deque<T>
unmodifiableDeque(java.util.Deque<T> deque)
Returns an unmodifiable view of the specified Deque.
-
-
-
Method Detail
-
unmodifiableDeque
public static <T> java.util.Deque<T> unmodifiableDeque(java.util.Deque<T> deque)
Returns an unmodifiable view of the specified Deque.- Type Parameters:
T
- type- Parameters:
deque
- underlyingDeque
to use.- Returns:
- unmodifiable view of
deque
-
forEach
public void forEach(java.util.function.Consumer<? super E> action)
- Specified by:
forEach
in interfacejava.lang.Iterable<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<E>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<E>
-
removeFirstOccurrence
public boolean removeFirstOccurrence(java.lang.Object o)
- Specified by:
removeFirstOccurrence
in interfacejava.util.Deque<E>
-
removeLastOccurrence
public boolean removeLastOccurrence(java.lang.Object o)
- Specified by:
removeLastOccurrence
in interfacejava.util.Deque<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
-
add
public boolean add(E e)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
offer
public boolean offer(E e)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<E>
-
remove
public E remove()
-
poll
public E poll()
-
element
public E element()
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
- Specified by:
removeIf
in interfacejava.util.Collection<E>
-
peek
public E peek()
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<E>
-
remove
public boolean remove(java.lang.Object o)
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<E>
- Overrides:
equals
in classjava.lang.Object
-
contains
public boolean contains(java.lang.Object o)
-
size
public int size()
-
iterator
public java.util.Iterator<E> iterator()
-
descendingIterator
public java.util.Iterator<E> descendingIterator()
- Specified by:
descendingIterator
in interfacejava.util.Deque<E>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<E>
- Overrides:
hashCode
in classjava.lang.Object
-
spliterator
public java.util.Spliterator<E> spliterator()
-
stream
public java.util.stream.Stream<E> stream()
- Specified by:
stream
in interfacejava.util.Collection<E>
-
parallelStream
public java.util.stream.Stream<E> parallelStream()
- Specified by:
parallelStream
in interfacejava.util.Collection<E>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-