You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2013/05/12 19:25:15 UTC

[jira] [Commented] (COLLECTIONS-347) [contribution] LimitedSizeFifoMap

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

Thomas Neidhart commented on COLLECTIONS-347:
---------------------------------------------

The same can be achieved with the following code:

{noformat}
    LRUMap<Integer, String> map = new LRUMap<Integer, String>(maxSize) {
        @Override
        protected void moveToMRU(LinkEntry<Integer, String> entry) {}
    };
{noformat}

This basically changes a LRUMap to a map with eviction in fifo order.
                
> [contribution] LimitedSizeFifoMap
> ---------------------------------
>
>                 Key: COLLECTIONS-347
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-347
>             Project: Commons Collections
>          Issue Type: New Feature
>          Components: Map
>            Reporter: Michael Thomas
>            Priority: Minor
>             Fix For: 4.x
>
>         Attachments: LimitedSizeFifoMap.patch, LimitedSizeFifoMap.patch
>
>
> The {{LimitedSizeFifoMap}} never exceeds a given element limit by deleting old entries, whenever new ones are inserted. It may be of use for caches holding memory-intense objects (it is for me, anyway).
> The patch contains:
> * the interface {{LimitedSizeMap}}
> * the fully documented implementation {{LimitedSizeFifoMap}}, which deletes the oldest items first
> * the accompanying unit test
> If you find anything that needs improvement, please let me know.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira