T
- type of the objects stored on this PeekStackpublic class PeekStack<T> extends ArrayList<T>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $,
initial version 24 jun. 2015
modCount
Constructor and Description |
---|
PeekStack() |
Modifier and Type | Method and Description |
---|---|
T |
peekNthLast(int offset)
Return the N-from-last element of this PeekStack.
|
T |
pop()
Pop an element off this stack.
|
void |
push(T element)
Push an element on this stack.
|
boolean |
topEntriesEqual(T... entries)
Check if the elements on the top of this PeekStack are equal to the provided entries.
|
String |
toString() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public final void push(T element)
element
- T; the element to push onto this stackpublic final T pop()
public final T peekNthLast(int offset)
offset
- int; if 0 the last pushed, but not yet popped element is returned; if offset is 1, the before last pushed,
but not yet popped element is returned; etc.public final boolean topEntriesEqual(T... entries)
entries
- T...; the provided entriespublic final String toString()
toString
in class AbstractCollection<T>
Copyright © 2014–2019 Delft University of Technology. All rights reserved.