Stack

class Stack[T]

Very minimal replacement for the SDK Stack implementation that was deprecated in Scala 2.12

class Object
trait Matchable
class Any

Value members

Concrete methods

def elements: List[T]

All current elements in this stack, with the top element returned as the first element.

All current elements in this stack, with the top element returned as the first element.

This is an immutable List.

def isEmpty: Boolean

Indicates whether this stack is empty.

Indicates whether this stack is empty.

def nonEmpty: Boolean

Indicates whether this stack contains at least one element.

Indicates whether this stack contains at least one element.

def pop: T

Returns the top element and removes it from the Stack.

Returns the top element and removes it from the Stack.

def push(elem: T): Unit

Pushes the specified element to the top the Stack.

Pushes the specified element to the top the Stack.

def top: T

Returns the top element without modifying the Stack.

Returns the top element without modifying the Stack.