Package io.microsphere.collection
Class DelegatingQueue<E>
- java.lang.Object
-
- io.microsphere.collection.DelegatingQueue<E>
-
- Type Parameters:
E
- the type of elements held in this queue
- All Implemented Interfaces:
DelegatingWrapper
,Wrapper
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Queue<E>
- Direct Known Subclasses:
DelegatingDeque
public class DelegatingQueue<E> extends java.lang.Object implements java.util.Queue<E>, DelegatingWrapper
DelegatingQueue
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
Queue
-
-
Constructor Summary
Constructors Constructor Description DelegatingQueue(java.util.Queue<E> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
E
element()
boolean
equals(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super E> action)
java.util.Queue<E>
getDelegate()
Get the delegateint
hashCode()
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
offer(E e)
java.util.stream.Stream<E>
parallelStream()
E
peek()
E
poll()
E
remove()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
removeIf(java.util.function.Predicate<? super E> filter)
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()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.microsphere.lang.DelegatingWrapper
isWrapperFor, unwrap
-
-
-
-
Field Detail
-
delegate
protected final java.util.Queue<E> delegate
-
-
Constructor Detail
-
DelegatingQueue
public DelegatingQueue(java.util.Queue<E> delegate)
-
-
Method Detail
-
add
public boolean add(E e)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
- Specified by:
addAll
in interfacejava.util.Collection<E>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<E>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<E>
-
iterator
public java.util.Iterator<E> iterator()
-
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>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<E>
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
- Specified by:
removeIf
in interfacejava.util.Collection<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<E>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
-
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>
-
forEach
public void forEach(java.util.function.Consumer<? super E> action)
- Specified by:
forEach
in interfacejava.lang.Iterable<E>
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<E>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<E>
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDelegate
public java.util.Queue<E> getDelegate()
Description copied from interface:DelegatingWrapper
Get the delegate- Specified by:
getDelegate
in interfaceDelegatingWrapper
- Returns:
- the delegate
-
-