All Bundles

Stack<H>

Growable stack of generics

Operations

New

Default constructor

New()

Empty

Clears the vector

method : public : Empty() ~ Nil

IsEmpty

Checks to see if the stack is empty

method : public : IsEmpty() ~ Bool
Return
TypeDescription
Booltrue if empty, false otherwise

Pop

Pops a value from the stack

method : public : Pop() ~ H
Return
TypeDescription
Hpopped valued, Nil if stack is empty

Pops values from the stack

method : public : Pop(n:Int) ~ H
Parameters
NameTypeDescription
nIntnumber of items to pop

Return
TypeDescription
Hpopped valued, Nil if stack is empty

Push

Pushes a value onto the stack

method : public : Push(value:H) ~ Nil
Parameters
NameTypeDescription
valueHto push

Size

Size of stack

method : public : Size() ~ Int
Return
TypeDescription
Intsize of stack

ToArray

Converts the stack into an object array

method : public : ToArray() ~ H[]
Return
TypeDescription
Hobject array

ToString

Formats the collection into a string. If an element implements the 'Stringify' interface, it's 'ToString()' is called.

method : public : ToString() ~ String
Return
TypeDescription
Stringstring representation

Top

Check the top of the stack

method : public : Top() ~ H
Return
TypeDescription
Hvalue on the top of stack, Nil if stack is empty