Package java.util

Examples of java.util.Vector.removeAll()


    v.add("Boom");
    v.removeAll(s);
    assertEquals("Should not have removed any elements", 3, v.size());
    l = new LinkedList();
    l.add(null);
    v.removeAll(l);
    assertEquals("Should only have one element", 1, v.size());
    assertEquals("Element should be 'Boom'", "Boom", v.firstElement());
  }

  /**
 
View Full Code Here


            }
            // Split the recipients into two pools.  notRecipients will contain the
            // recipients on the message that the matcher did not return.
            Collection notRecipients = new Vector();
            notRecipients.addAll(mail.getRecipients());
            notRecipients.removeAll(recipients);

            if (recipients.size() == 0) {
                //Everything was not a match... store it in the next spot in the array
                unprocessed[i + 1].add(mail);
                continue;
View Full Code Here

         if (new_mbrs != null)
         {
            // Determine what members have been removed
            // and roll back any tx and break any locks
            Vector removed = (Vector) members.clone();
            removed.removeAll(new_mbrs);
            removeLocksForDeadMembers(root, removed);

            members.removeAllElements();
            members.addAll(new_view.getMembers());
View Full Code Here

    v.addElement(l);

    Collection s = new HashSet();
    Object o;
    s.add(o = v.firstElement());
    v.removeAll(s);
    assertTrue("Failed to remove items in collection", !v.contains(o));
    v.removeAll(l);
    assertTrue("Failed to remove all elements", v.isEmpty());

    v.add(null);
View Full Code Here

    Collection s = new HashSet();
    Object o;
    s.add(o = v.firstElement());
    v.removeAll(s);
    assertTrue("Failed to remove items in collection", !v.contains(o));
    v.removeAll(l);
    assertTrue("Failed to remove all elements", v.isEmpty());

    v.add(null);
    v.add(null);
    v.add("Boom");
View Full Code Here

    assertTrue("Failed to remove all elements", v.isEmpty());

    v.add(null);
    v.add(null);
    v.add("Boom");
    v.removeAll(s);
    assertEquals("Should not have removed any elements", 3, v.size());
    l = new LinkedList();
    l.add(null);
    v.removeAll(l);
    assertEquals("Should only have one element", 1, v.size());
View Full Code Here

    v.add("Boom");
    v.removeAll(s);
    assertEquals("Should not have removed any elements", 3, v.size());
    l = new LinkedList();
    l.add(null);
    v.removeAll(l);
    assertEquals("Should only have one element", 1, v.size());
    assertEquals("Element should be 'Boom'", "Boom", v.firstElement());
  }

  /**
 
View Full Code Here

     * local_addr. Therefore, true is returned.
     */
    boolean wouldIBeCoordinator() {
        Address new_coord;
        Vector mbrs=gms.members.getMembers(); // getMembers() returns a *copy* of the membership vector
        mbrs.removeAll(suspected_mbrs);
        if(mbrs.size() < 1) return false;
        new_coord=(Address)mbrs.elementAt(0);
        return gms.local_addr.equals(new_coord);
    }

View Full Code Here

         return getTransactionMethodsFor(clazz, disallowedMethods);
     }
    
     private Collection getTransactionMethodsFor(Class interfaceImpl, Collection disallowedMethods) {
         Vector v = new Vector(Arrays.asList(interfaceImpl.getMethods()));
         v.removeAll(disallowedMethods);
         return v;
     }        
    
     private Collection getTransactionMethodsFor(Class interfaceType, Class interfaceImpl) {
         Collection disallowedTransactionMethods = getDisallowedTransactionMethodsFor(interfaceType);
View Full Code Here

         return getTransactionMethodsFor(clazz, disallowedMethods);
     }
    
     private Collection getTransactionMethodsFor(Class interfaceImpl, Collection disallowedMethods) {
         Vector v = new Vector(Arrays.asList(interfaceImpl.getMethods()));
         v.removeAll(disallowedMethods);
         return v;
     }        
    
     private Collection getTransactionMethodsFor(Class interfaceType, Class interfaceImpl) {
         Collection disallowedTransactionMethods = getDisallowedTransactionMethodsFor(interfaceType);
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.