Examples of retainAll()


Examples of java.util.ArrayList.retainAll()

    public boolean retainAll(Collection collection) {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                boolean result = temp.retainAll(collection);
                list = temp;
                return (result);
            }
        } else {
            synchronized (list) {
View Full Code Here

Examples of java.util.Collection.retainAll()

      {
         //start FLUSH only on group members that we need to flush
         if (view != null)
         {
            participantsInFlush = new ArrayList(view.getMembers());
            participantsInFlush.retainAll(currentView.getMembers());
         }
         else
         {
            participantsInFlush = new ArrayList(currentView.getMembers());
         }
View Full Code Here

Examples of java.util.Collection.retainAll()

        }

        boolean added_b = b.add("element1");
        try {
            assertTrue(!a.retainAll(b));
            assertTrue(added_b == b.retainAll(a));
            assertTrue(b.isEmpty());
        } catch(UnsupportedOperationException e) {
            // expected
        } catch(Throwable t) {
            t.printStackTrace();
View Full Code Here

Examples of java.util.Collection.retainAll()

        boolean added_b1 = b.add("element1");
        boolean added_b2 = b.add("element2");
        boolean added_a1 = a.add("element1");
        if(added_b1 && added_b2 && added_a1) {
            try {
                assertTrue(!b.retainAll(b));
                assertTrue(b.contains("element1"));
                assertTrue(b.contains("element2"));

                assertTrue(!a.retainAll(b));
View Full Code Here

Examples of java.util.Collection.retainAll()

                assertTrue(b.contains("element1"));
                assertTrue(b.contains("element2"));

                assertTrue(!a.retainAll(b));

                assertTrue(b.retainAll(a));
                assertTrue(b.contains("element1"));
                assertTrue(!b.contains("element2"));
            } catch(UnsupportedOperationException e) {
                // expected
            } catch(Throwable t) {
View Full Code Here

Examples of java.util.Collection.retainAll()

            result.put(added, properties.getSVNPropertyValue(added));
        }

        // changed in props2
        tmp = new TreeSet(props2);
        tmp.retainAll(props1);
       
        for (Iterator props = tmp.iterator(); props.hasNext();) {
            String changed = (String) props.next();
            SVNPropertyValue value1 = getSVNPropertyValue(changed);
            SVNPropertyValue value2 = properties.getSVNPropertyValue(changed);
View Full Code Here

Examples of java.util.Collection.retainAll()

        }

        boolean added_b = b.add("element1");
        try {
            assertTrue(!a.retainAll(b));
            assertTrue(added_b == b.retainAll(a));
            assertTrue(b.isEmpty());
        } catch(UnsupportedOperationException e) {
            // expected
        } catch(Throwable t) {
            t.printStackTrace();
View Full Code Here

Examples of java.util.HashSet.retainAll()

                       if(pactions==null){
                            pactions=cactions;
                       
                        } else{
                            HashSet h=new HashSet(cactions.keySet());
                            h.retainAll(pactions.keySet());
                            Iterator it=pactions.keySet().iterator();
                            while(it.hasNext()){
                                if(!h.contains(it.next())){
                                    it.remove();
                                }
View Full Code Here

Examples of java.util.HashSet.retainAll()

     */
    private Set determineCommonDeclarations()
    {
        Set commonDeclarations = new HashSet( this.leftInput.getTupleDeclarations( ) );

        commonDeclarations.retainAll( this.rightInput.getTupleDeclarations( ) );

        return commonDeclarations.isEmpty( ) ? Collections.EMPTY_SET : Collections.unmodifiableSet( commonDeclarations );
    }

    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
View Full Code Here

Examples of java.util.HashSet.retainAll()

        boolean localOnly = contributionMarkers.contains(Local.class);

        Flow<ServiceDef2> serviceDefs = localOnly ? getLocalServiceDefs(moduleDef) : F.flow(allServiceDefs);

        contributionMarkers.retainAll(getMarkerAnnotations());
        contributionMarkers.remove(Local.class);

        // Match services with the correct interface AND having as markers *all* the marker annotations
       
        Flow<ServiceDef2> filtered = serviceDefs.filter(new Predicate<ServiceDef2>()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.