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

Generic versions of Predicated, Syncronized and Unmodifiable classes

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 4.0-alpha1, 4.0
    • Component/s: Bag, Collection, List, Set
    • Labels:
      None
    • Environment:

      OS X

      Description

      I added generics to some more classes and fixed some compilation problems.

      The generic version of Transformer required the input and output types to be identical. This seemed to me to reduce the usefulness of transformed collections, as transforming one type into another seems like it would be a fairly common operation. I'm not sure how to fix this, however, as it also doesn't seem feasible to have a generic TransformedCollection with different input and output types that implements Collection<E>. Anyway, this patch de-generifies TransformedCollection, which also fixes some compilation problems. Please disregard this change if you disagree and have a better solution.

      The modified collection classes are:

      Bags: PredicatedSortedBag, AbstractBagDecorator, SynchronizedBag, UnmodifiableSortedBag, SynchronizedSortedBag, PredicatedBag
      Lists: PredicatedList, SynchronizedList
      Sets: PredicatedSortedSet, SynchronizedSortedSet, PredicatedSet, UnmodifiableSortedSet, SynchronizedSet
      Miscellaneous: PredicatedBuffer

        Attachments

        1. collections_06_03_11.patch
          58 kB
          Edwin Tellman

          Issue Links

            Activity

              People

              • Assignee:
                shammah Stephen Kestle
                Reporter:
                etellman Edwin Tellman
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: