You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Roger Whitcomb (JIRA)" <ji...@apache.org> on 2018/01/11 16:07:00 UTC

[jira] [Commented] (PIVOT-1022) Add maximum limit to our stack implementations

    [ https://issues.apache.org/jira/browse/PIVOT-1022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322461#comment-16322461 ] 

Roger Whitcomb commented on PIVOT-1022:
---------------------------------------

Implemented here:
Sending        core\src\org\apache\pivot\collections\ArrayStack.java
Sending        core\src\org\apache\pivot\collections\LinkedStack.java
Sending        core\src\org\apache\pivot\collections\Stack.java
Sending        core\src\org\apache\pivot\collections\concurrent\SynchronizedStack.java
Sending        core\test\org\apache\pivot\collections\test\StackTest.java
Transmitting file data .....done
Committing transaction...
Committed revision 1820896.


> Add maximum limit to our stack implementations
> ----------------------------------------------
>
>                 Key: PIVOT-1022
>                 URL: https://issues.apache.org/jira/browse/PIVOT-1022
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-collections
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> In an obvious use case for a stack:  namely the TextPane "undo" stack, the "Stack" class was not used because there is an enforced limit, which was not a feature of our stack class.  So, adding an optional limit would allow this use case without duplicating code.
> The limit would check after a "push" operation to see if the total stack depth then exceeds the limit, which would then remove the oldest element in that case.  (This is the way the code in TextPane works.)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)