Description | |
|
A Stack is principally used in supoort of nesting - each level of nesting adds (pushes) a return value to the stack, retrieving (popping) the value on the way out.
Data is added to the top of the stack, and taken from the top, although methods are provided, such as GetEnumerator and Peek that allow processing over and above this simple first-in, first-out way.
The Stack may be constructed from scratch or from an existing stack or list. Control is provided over the capacity.
|
|
Syntax | |
|
Constructor Create ; | Constructor Create ( |
Collection : ICollection ); | Constructor Create ( |
InitialCapacity : Integer ); |
|
Methods | |
|
| Clear | Clear (remove) all entries from the current Stack |
| Clone | Make a new Stack that is a clone of the current Stack |
| Contains | Returns true if the current Stack contains the given Value |
| CopyTo | Copies elements from the Stack to a single dimension array |
| GetEnumerator | Gets an enumerator to allow reading the elements of the current Stack |
| Pop | Remove the item from the top of the current Stack |
| Push | Add an item to the top of the current Stack |
| ToArray | Copies elements from the Stack to a new single dimension array |
|
|
|
Properties | |
|
Count | | Integer | | Gets the number of elements contained in the Stack. |
IsSynchronized | | Boolean | | Gets a value indicating whether access to the Stack is synchronized (thread-safe). |
SyncRoot | | Object | | Gets an object that can be used to synchronize access to the Stack |
|
Delphi Basics links | |
|
|
Microsoft MSDN links | |
|
|