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

Add boolean intersects(Collection c1, Collection c2) to Collections

XMLWordPrintable



      Name: skT45625 Date: 05/19/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      The Collection intereface has the following methods:
      boolean contains(Object o)
      boolean containsAll(Collection c)

      Another useful method, particularly when using collections as sets, is

      boolean containsAny(Collection c)

      This would return true if the Collections had any element in common, false
      otherwise. In effect, this implements an intersects predicate.
      (Review ID: 105100)
      ======================================================================

            jjb Josh Bloch (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: