Class UnmodifiableDeque<T>
- java.lang.Object
-
- org.marketcetera.util.collections.UnmodifiableDeque<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Deque<T>,Queue<T>
@NotThreadSafe public class UnmodifiableDeque<T> extends Object implements Deque<T>
Provides aDequeimplementation that cannot be modified.This class is not thread-safe: if thread-safety is required external synchronization is necessary.
- Since:
- 2.1.4
- Version:
- $Id: UnmodifiableDeque.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- Colin DuPlantis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classUnmodifiableDeque.UnmodifiableIteratorProvides anIteratorimplementation that cannot be used to modify the underlyingCollection.
-
Field Summary
Fields Modifier and Type Field Description private Deque<T>innerCollectionunderlying collection used to store managed data
-
Constructor Summary
Constructors Constructor Description UnmodifiableDeque(Deque<T> inCollection)Create a new UnmodifiableDeque instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T inE)booleanaddAll(Collection<? extends T> inC)voidaddFirst(T inE)voidaddLast(T inE)voidclear()booleancontains(Object inO)booleancontainsAll(Collection<?> inC)Iterator<T>descendingIterator()Telement()booleanequals(Object obj)TgetFirst()TgetLast()inthashCode()booleanisEmpty()Iterator<T>iterator()booleanoffer(T inE)booleanofferFirst(T inE)booleanofferLast(T inE)Tpeek()TpeekFirst()TpeekLast()Tpoll()TpollFirst()TpollLast()Tpop()voidpush(T inE)Tremove()booleanremove(Object inO)booleanremoveAll(Collection<?> inC)TremoveFirst()booleanremoveFirstOccurrence(Object inO)TremoveLast()booleanremoveLastOccurrence(Object inO)booleanretainAll(Collection<?> inC)intsize()Object[]toArray()<C> C[]toArray(C[] inA)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
addAll
public boolean addAll(Collection<? extends T> inC)
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>
-
containsAll
public boolean containsAll(Collection<?> inC)
- Specified by:
containsAllin interfaceCollection<T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<T>
-
removeAll
public boolean removeAll(Collection<?> inC)
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
public boolean retainAll(Collection<?> inC)
- Specified by:
retainAllin interfaceCollection<T>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <C> C[] toArray(C[] inA)
- Specified by:
toArrayin interfaceCollection<T>
-
add
public boolean add(T inE)
-
contains
public boolean contains(Object inO)
-
descendingIterator
public Iterator<T> descendingIterator()
- Specified by:
descendingIteratorin interfaceDeque<T>
-
element
public T element()
-
offer
public boolean offer(T inE)
-
offerFirst
public boolean offerFirst(T inE)
- Specified by:
offerFirstin interfaceDeque<T>
-
peek
public T peek()
-
poll
public T poll()
-
remove
public T remove()
-
remove
public boolean remove(Object inO)
-
removeFirst
public T removeFirst()
- Specified by:
removeFirstin interfaceDeque<T>
-
removeFirstOccurrence
public boolean removeFirstOccurrence(Object inO)
- Specified by:
removeFirstOccurrencein interfaceDeque<T>
-
removeLast
public T removeLast()
- Specified by:
removeLastin interfaceDeque<T>
-
removeLastOccurrence
public boolean removeLastOccurrence(Object inO)
- Specified by:
removeLastOccurrencein interfaceDeque<T>
-
size
public int size()
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceCollection<T>- Overrides:
equalsin classObject
-
-