Class StackIterator
Defined in: DataStructures.js.
Constructor Attributes | Constructor Name and Description |
---|---|
StackIterator(aggregate)
Class that implements the iterator for a linked list.
|
Field Attributes | Field Name and Description |
---|---|
The aggregate relates to this iterator.
|
|
The pointer to the position.
|
Method Attributes | Method Name and Description |
---|---|
first()
Moves the iterator to the first position of the aggregate.
|
|
getItem()
Returns the item stored at the position pointed by the iterator.
|
|
isDone()
Checks if the iterator is out of the bounds of the aggregate.
|
|
last()
Moves the iterator to the last position of the aggregate.
|
|
next()
Moves the iterator to the next item.
|
|
previous()
Moves the iterator to the previous item.
|
Class Detail
StackIterator(aggregate)
Class that implements the iterator for a linked list.
- Parameters:
- aggregate
- {Stack} The aggregate to scan.
Field Detail
aggregate
The aggregate relates to this iterator.
pointer
The pointer to the position.
Method Detail
{void}
first()
Moves the iterator to the first position of the aggregate.
- Returns:
- {void}
{*}
getItem()
Returns the item stored at the position pointed by the iterator.
- Returns:
- {*} The item stored or undefined if it's out of the bounds.
{boolean}
isDone()
Checks if the iterator is out of the bounds of the aggregate.
- Returns:
- {boolean} It return true if the iterator is out of the bounds of the aggregate, otherwise false.
{void}
last()
Moves the iterator to the last position of the aggregate.
- Returns:
- {void}
{void}
next()
Moves the iterator to the next item.
- Returns:
- {void}
{void}
previous()
Moves the iterator to the previous item.
- Returns:
- {void}