Import std.collections.stack
std.collections.stack
A last-in, first-out stack.
Push puts a value on top, and Pop takes the top one off.
std/collections/stack.fb
Types
Stack
class
@DebugElements Public Class Stack<T> Implements Iterable<T>, Cloneable, Defaultable
Last in, first out: Push puts a value on top, and Pop takes the top one off.
Examples
Local stack = Stack<Int>()
stack.Push(1)
stack.Push(2)
Expect(stack.Pop() == 2)
Expect(stack.Count == 1)std/collections/stack.fb, line 20
-
How many values it holds.
-
Puts
valueon top. -
The same as Push.
-
Pushes each of the
values, in order, so the last ends up on top. -
Takes the top value off and gives it. Panics when the Stack is empty.
-
The top value, which stays. Panics when the Stack is empty.
-
Takes the top value off and gives it, or Null when the Stack is empty.
-
The top value, which stays, or Null when the Stack is empty.
-
The values from the top down, the order Pop gives them, in a new array.
-
Whether it holds
value. -
Takes every value off.
-
A new, empty Stack.
-
A new Stack with the same values.
-
The values from the top down, the order Pop gives them. Changing the Stack while going over them panics.
StackIterator
struct
Public Struct StackIterator<T> Implements Iterator<T>
The values of a Stack, from the top down, which a For loop goes over.
std/collections/stack.fb, line 112
-
The next value, from the top down, or Null after the bottom one. Panics when the Stack changed since the loop began.
Report an issue with this page or with FutureBlitz on GitHub.