ArrayStack

a simple array based stack

no bound checking is done, so be careful

Constructors

this
this(uinteger length)

constructor (set the stack length here)

Members

Functions

peek
void peek(uinteger index)

Moves peek pointer to index

pop
T pop()

Pops an element from stack

pop
T[] pop(uinteger n)

Reads n number of elements from stack, in reverse order (i.e: [nth-last pushed, (n-1)th-last pushed, ..., last pushed])

push
void push(T element)

pushes an element to stack

push
void push(T[] elements)

pushes elements to stack. First in array is pushed first

read
T read(uinteger index)
readPtr
T* readPtr(uinteger index)
write
void write(uinteger index, T value)

Writes a value to index

Properties

count
uinteger count [@property getter]

number of elements in stack

Meta