Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4193200

Request for Collections.count method

XMLWordPrintable



      Name: clC74495 Date: 11/26/98


      Another useful method to add to Collections might
      be a count method, to return the number of
      instances of an object in a Collection / List:

        int count( List list, Object o )

      This would return the number of entries, e,
      in list where e.equals( o ) == true.

      It could have a further option to provide a
      Comparator to determine equality:

        int count( List list, Object o, Comparator c )
      (Review ID: 43336)
      ======================================================================

            jjb Josh Bloch
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: