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

TreeBag with comparator does not store non-key duplicates.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.2.1
    • None
    • Bag
    • None

    Description

      When storing objects that are sorted by a Comparator, if the differences in the objects are not in the comparator the same version of the object is returned. I expected that the sorted bag would work like a DB table with a non-unique key – ordered but duplicate only determined by Object.equals().

      I have implemented this type of bag using a TreeMap of List. My implementation uses the Jena ExtendedIterator to make building the iterator() and array() methods easier.

      Will attach the code.

      Attachments

        1. SortedBag.java
          2 kB
          Claude Warren
        2. COLLECTIONS-439.tar.gz
          4 kB
          Claude Warren
        3. BagTest.java
          3 kB
          Thomas Neidhart

        Activity

          People

            Unassigned Unassigned
            claude Claude Warren
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: