| Package | de.polygonal.ds |
| Class | public class ArrayedStack |
| Inheritance | ArrayedStack Object |
| Implements | Collection |
See also
| Property | Defined By | ||
|---|---|---|---|
| maxSize : int [read-only]
The stack's maximum capacity. | ArrayedStack | ||
| size : int [read-only]
The total number of items. | ArrayedStack | ||
| Method | Defined By | ||
|---|---|---|---|
ArrayedStack(size:int)
Initializes a stack to match the given size. | ArrayedStack | ||
clear():void
Clears all items. | ArrayedStack | ||
contains(obj:*):Boolean
Determines if the collection contains a given item. | ArrayedStack | ||
dump():String
Prints out all elements (for debug/demo purposes). | ArrayedStack | ||
getAt(i:int):*
Reads an item at a given index. | ArrayedStack | ||
Initializes an iterator object pointing to the first item in the
collection. | ArrayedStack | ||
isEmpty():Boolean
Checks if the collection is empty. | ArrayedStack | ||
peek():*
Indicates the top item. | ArrayedStack | ||
pop():*
Pops data off the stack. | ArrayedStack | ||
push(obj:*):Boolean
Pushes data onto the stack. | ArrayedStack | ||
setAt(i:int, obj:*):void
Writes an item at a given index. | ArrayedStack | ||
toArray():Array
Converts the collection into an array. | ArrayedStack | ||
toString():String
Prints out a string representing the current object. | ArrayedStack | ||
| maxSize | property |
maxSize:int [read-only] The stack's maximum capacity.
public function get maxSize():int| size | property |
size:int [read-only] The total number of items.
public function get size():int| ArrayedStack | () | Constructor |
public function ArrayedStack(size:int)Initializes a stack to match the given size.
Parameterssize:int — The maximum allowed size.
|
| 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.
|
| getAt | () | method |
public function getAt(i:int):*Reads an item at a given index.
Parameters
i:int — The index.
|
* — The item at the given index.
|
| 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:*):BooleanPushes data onto the stack.
Parameters
obj:* — The data.
|
Boolean |
| setAt | () | method |
public function setAt(i:int, obj:*):voidWrites an item at a given index.
Parameters
i:int — The index.
| |
obj:* — The data.
|
| 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.
|