Stack

laika.collection.Stack
class Stack[T]

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

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

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.

Attributes

def isEmpty: Boolean

Indicates whether this stack is empty.

Indicates whether this stack is empty.

Attributes

def nonEmpty: Boolean

Indicates whether this stack contains at least one element.

Indicates whether this stack contains at least one element.

Attributes

def pop: T

Returns the top element and removes it from the Stack.

Returns the top element and removes it from the Stack.

Attributes

def push(elem: T): Unit

Pushes the specified element to the top the Stack.

Pushes the specified element to the top the Stack.

Attributes

def top: T

Returns the top element without modifying the Stack.

Returns the top element without modifying the Stack.

Attributes