-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.1
-
Component/s: core-collections
-
Labels:None
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.)