Stack<E> class

A stack data structure.

Constructors

Stack()

Properties

hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Returns true if the stack is empty.
no setter
isNotEmpty bool
Returns true if the stack is not empty.
no setter
length int
Returns the number of elements in the stack.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
top → E
Returns the top element, without removing it.
no setter

Methods

distanceToElementWhere(bool test(E element)) int?
Calculate how far back in the stack a matching element is.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek() → E
Returns the top element, without removing it.
pop() → E
Removes the top element and returns it.
push(E item) → void
Pushes an element onto the top of the stack.
pushAll(Stack<E> other) → void
Pushes all elements of other to the stack.
toList() List<E>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override