[ https://issues.apache.org/jira/browse/PIVOT-1022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322915#comment-16322915 ]
Roger Whitcomb commented on PIVOT-1022: --------------------------------------- Made the same enhancements to Queue and its implementors: Sending core\src\org\apache\pivot\collections\ArrayQueue.java Sending core\src\org\apache\pivot\collections\LinkedQueue.java Sending core\src\org\apache\pivot\collections\Queue.java Sending core\src\org\apache\pivot\collections\Stack.java Sending core\src\org\apache\pivot\collections\concurrent\SynchronizedQueue.java Sending core\test\org\apache\pivot\collections\test\QueueTest.java Sending core\test\org\apache\pivot\collections\test\StackTest.java Transmitting file data .......done Committing transaction... Committed revision 1820931. > 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)