Class UndoManager.CircularStack
Defined in: UndoManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
UndoManager.CircularStack(maxSize)
Creates a new CircularStack.
|
Method Attributes | Method Name and Description |
---|---|
clear()
Clears the stack.
|
|
<private> |
Gets the position of the previously inserted item in the buffer.
|
isEmpty()
Checks whether the stack is empty.
|
|
peek()
Returns but not removes the top most item of the stack.
|
|
pop()
Returns and removes the top most item of the stack.
|
|
push(item)
Pushes a new item onto the stack.
|
Class Detail
UndoManager.CircularStack(maxSize)
Creates a new CircularStack. This is a stack implementation backed by a
circular buffer where the oldest entries automatically are overwritten when
new items are pushed onto the stack and the maximum size has been reached.
- Parameters:
- {Integer} maxSize Optional, Default: 32
Method Detail
clear()
Clears the stack.
<private>
{Integer}
getPreviousPointer()
Gets the position of the previously inserted item in the buffer.
- Returns:
- {Integer} the previous pointer position or null if no previous exists.
{Boolean}
isEmpty()
Checks whether the stack is empty.
- Returns:
- {Boolean} true if empty, false otherwise.
{Any}
peek()
Returns but not removes the top most item of the stack.
- Returns:
- {Any} the last inserted item or null if stack is empty.
{Any}
pop()
Returns and removes the top most item of the stack.
- Returns:
- {Any} the last inserted item or null if stack is empty.
push(item)
Pushes a new item onto the stack.
- Parameters:
- {Any} item