| Package | de.polygonal.ds |
| Class | public class LinkedStack |
| Inheritance | LinkedStack Object |
| Implements | Collection |
See also
| Property | Defined By | ||
|---|---|---|---|
| size : int [read-only]
The total number of items. | LinkedStack | ||
| Method | Defined By | ||
|---|---|---|---|
LinkedStack(list:DLinkedList = null)
Initializes a new stack. | LinkedStack | ||
clear():void
Clears all items. | LinkedStack | ||
contains(obj:*):Boolean
Determines if the collection contains a given item. | LinkedStack | ||
dump():String
Prints out all elements (for debug/demo purposes). | LinkedStack | ||
Initializes an iterator object pointing to the first item in the
collection. | LinkedStack | ||
isEmpty():Boolean
Checks if the collection is empty. | LinkedStack | ||
peek():*
Indicates the top item. | LinkedStack | ||
pop():*
Pops data off the stack. | LinkedStack | ||
push(obj:*):void
Pushes data onto the stack. | LinkedStack | ||
toArray():Array
Converts the collection into an array. | LinkedStack | ||
toString():String
Prints out a string representing the current object. | LinkedStack | ||
| size | property |
size:int [read-only] The total number of items.
public function get size():int| LinkedStack | () | Constructor |
public function LinkedStack(list:DLinkedList = null)Initializes a new stack. You can pass an existing doubly linked list to provide stack-like access.
Parameterslist:DLinkedList (default = null) — An existing list to become the stack.
|
| clear | () | method |
public function clear():voidClears all items.
| contains | () | method |
public function contains(obj:*):BooleanDetermines if the collection contains a given item.
Parameters
obj:* — The item to search for.
|
Boolean — True if the item exists, otherwise false.
|
| dump | () | method |
public function dump():StringPrints out all elements (for debug/demo purposes).
ReturnsString — A human-readable representation of the structure.
|
| getIterator | () | method |
public function getIterator():IteratorInitializes an iterator object pointing to the first item in the collection.
ReturnsIterator — An iterator object.
|
| isEmpty | () | method |
public function isEmpty():BooleanChecks if the collection is empty.
ReturnsBoolean — True if empty, otherwise false.
|
| peek | () | method |
public function peek():*Indicates the top item.
Returns* — The top item.
|
| pop | () | method |
public function pop():*Pops data off the stack.
Returns* — A reference to the top item or null if the stack is empty.
|
| push | () | method |
public function push(obj:*):voidPushes data onto the stack.
Parameters
obj:* — The data to insert.
|
| toArray | () | method |
public function toArray():ArrayConverts the collection into an array.
ReturnsArray — An array.
|
| toString | () | method |
public function toString():StringPrints out a string representing the current object.
ReturnsString — A string representing the current object.
|