Class ADT.Stack (< ElementType >)

Description

This class implements a simple stack. Instead of adding and removing elements to an array, and thus making it vary in size for every push and pop operation, this stack tries to keep the stack size constant. If however the stack risks to overflow, it will allocate double its current size, i.e. pushing an element on an full 32 slot stack will result in a 64 slot stack with 33 elements.


Generic ElementType

__generic__ mixed ElementType = mixed

Description

Type for the elements on the stack.


Method create

ADT.Stack ADT.Stack(int(1..)|void initial_size)

Description

An initial stack size can be given when a stack is cloned. The default value is 32.