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

Add indexed get to CircularFifoQueue

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-alpha1, 4.0
    • Component/s: None
    • Labels:
      None

      Description

      Since the BoundedFifoBuffer is implemented as an array, it should be simple to implement random access to any element of the buffer.

      [This functionality was requested on the Commons user list]

      For example:

      // get nth entry; i.e. get(0) is the same as get()
      // NoSuchElementException if i >= numEntries
      // if i < 0, could either throw an Exception or treat as reverse index from end of buffer
      E get(int i)

      This would also work for the sub-class CircularFifoBuffer.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebb Sebb
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: