(collection) Object count method.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P5
    • None
    • Affects Version/s: 6
    • Component/s: core-libs

      A DESCRIPTION OF THE REQUEST :
      Java Lists currently do not have a way of getting the count of a particular object within a List.

      JUSTIFICATION :
      I ran into this issue when I had a list of objects in which it contained some duplicates, and I needed to know the number of occurrences of specific objects within the list. Basically i built a list of referenced objects from a list of objects and needed the result of how many times a specific referenced object was in this built list, for later use.

      I needed something like... myList.elementCount(obj);
      where elementCount() returns int number of occurrences or -1 if it does not exist in the list, and obj is the assumed element in the list.

      I was able to continue by creating a custom iterator, but the above alternative would have been a quicker solution.

            Assignee:
            Unassigned
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: