Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-224

[PATCH] Proposal for a new collection type KeyedBuffer

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • Buffer
    • None

    Description

      Patch contains three new files:
      KeyedPriorityBuffer - class based on PriorityBuffer; with additional support for fast search and remove
      KeyedBuffer - general interface for all buffers containing key-identified elements
      TestKeyedPriorityBuffer - JUnit test cases

      Rationale for introducing new types: I needed a buffer with additional fast search (both get and remove) of elements. I wanted a buffer with search characteristics of a HashMap. But one cannot simply put together a Buffer with a HashMap since the Map needs to have an access to the internal buffer data structures to manage fast remove(key).
      KeyedPriorityBuffer is mixin of a PriorityBuffer with a internal HashMap managing fast search operations.
      KeyedBuffer is a general interface for all such buffers supporting key operations. It extends Map rather than Collection since imho it is more natural.

      Attachments

        1. KeyedPriorityBuffer-patch.txt
          54 kB
          Mariusz Krzemien

        Activity

          People

            Unassigned Unassigned
            mkrzemien Mariusz Krzemien
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: