Bulk operations are particularly well suited to
Sets; when applied, they perform standard set-algebraic operations. Suppose s1 and s2 are sets. Here's what bulk operations do:s1.containsAll(s2)— returnstrueifs2is a subset ofs1. (s2is a subset ofs1if sets1contains all of the elements ins2.)s1.addAll(s2)— transformss1into the union ofs1ands2. (The union of two sets is the set containing all of the elements contained in either set.)s1.retainAll(s2)— transformss1into the intersection ofs1ands2. (The intersection of two sets is the set containing only the elements common to both sets.)s1.removeAll(s2)— transformss1into the (asymmetric) set difference ofs1ands2. (For example, the set difference ofs1minuss2is the set containing all of the elements found ins1but not ins2.)
Refrences:
No comments:
Post a Comment