Package io.karma.sliced.view
Interface QueueView<T>
- All Known Subinterfaces:
DequeView<T>
- All Known Implementing Classes:
DequeViewImpl
,EmptyDequeView
,EmptyQueueView
,QueueViewImpl
A specialized
View
for Queue
,
which provides an additional set of functionality over
the regular view access.- Since:
- 09/08/2022
-
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface io.karma.sliced.view.View
asSlice, contains, containsAll, containsAllRefs, containsRef, contentEquals, contentEquals, copy, copyArrayList, copyHashSet, forAll, forAllIndexed, forEachIndexed, parallelStream, referencesEqual, referencesEqual, size, stream, toArray
-
Method Details
-
empty
Creates an empty queue view for the given type which has no elements.- Returns:
- An empty queue view for the given type which has no elements.
-
of
Creates a new view instance which references the givenQueue
.- Type Parameters:
T
- The element type of the given queue, and the newly created view.- Parameters:
queue
- The queue of which to create a view.- Returns:
- A new view instance, which references the given queue.
-
peek
T peek()Retrieves the first element from the queue. Returns null if the queue is empty.- Returns:
- The first element from the queue. Null if the queue is empty.
-