Package java.util

Examples of java.util.Set.retainAll()


/*      */
/*  908 */       c = nav().getSuperClass(c);
/*  909 */     }while (shouldRecurseSuperClass(c));
/*      */
/*  913 */     Set complete = new TreeSet(getters.keySet());
/*  914 */     complete.retainAll(setters.keySet());
/*      */
/*  916 */     resurrect(getters, complete);
/*  917 */     resurrect(setters, complete);
/*      */
/*  920 */     for (String name : complete) {
View Full Code Here


         {
            transactionIds.clear();
         }
         else if (a.getType() == MultiIndex.Action.TYPE_VOLATILE_COMMIT)
         {
            transactionIds.retainAll(losers);
            // check if transactionIds contains losers
            if (transactionIds.size() > 0)
            {
               // found dirty volatile commit
               break;
View Full Code Here

      blacklistClone.putAll(globalBlacklist);
    }
    Set keys = blacklistClone.keySet();
   
    // we're only interested in blacklisted hosts that are in the hostList
    keys.retainAll(this.hostList);
    if(keys.size() == this.hostList.size()){
      // return an empty blacklist, let the BalanceStrategy implementations try to connect to everything
      // since it appears that all hosts are unavailable - we don't want to wait for
      // loadBalanceBlacklistTimeout to expire.
      return new HashMap(1);      
View Full Code Here

    private static Method getCallbackMethod(Class cls) {
        // Look at only public methods defined by the Callback class
        Method[] pubMethods = cls.getDeclaredMethods();
        Method[] classMethods = cls.getMethods();
        Set pmethods = new HashSet(Arrays.asList(pubMethods));
        pmethods.retainAll(Arrays.asList(classMethods));

        // Remove Object methods disallowed as callback method names
        for (Iterator i=pmethods.iterator();i.hasNext();) {
            Method m = (Method)i.next();
            if (Callback.FORBIDDEN_NAMES.contains(m.getName())) {
View Full Code Here

    private static Method getCallbackMethod(Class cls) {
        // Look at only public methods defined by the Callback class
        Method[] pubMethods = cls.getDeclaredMethods();
        Method[] classMethods = cls.getMethods();
        Set pmethods = new HashSet(Arrays.asList(pubMethods));
        pmethods.retainAll(Arrays.asList(classMethods));

        // Remove Object methods disallowed as callback method names
        for (Iterator i=pmethods.iterator();i.hasNext();) {
            Method m = (Method)i.next();
            if (Callback.FORBIDDEN_NAMES.contains(m.getName())) {
View Full Code Here

      // first construct a set containing all the elements in orig
      Set items = new HashSet(Arrays.asList(orig));

      // then remove all those not in rev
      items.retainAll(Arrays.asList(rev));

      Map eqs = new HashMap();
      for (int i = 0; i < orig.length; i++)
      {
         // if its a common item and hasn't been found before
View Full Code Here

     * @param grailsDomainClasses the collection of valid sub-classes
     * @return the collection of subclasses, if any
     */
    public static Collection getSubClasses(GrailsDomainClass grailsDomainClass, Collection grailsDomainClasses) {
        Set subClasses = new HashSet(grailsDomainClass.getSubClasses());
        subClasses.retainAll(grailsDomainClasses);
        return subClasses;
    }

    /**
     * Get the parent GrailsDomainClass for the given GrailsDomainClass, if it
View Full Code Here

    Set those = plugin.getPeerGroups();
    if (those == null || those.isEmpty())
      return true;

    // We check for a single match.
    those.retainAll(peerGroups.entrySet());
    if (those.isEmpty())
      // No common elements
      return false;

    if (! strict)
View Full Code Here

      return true;

    // Determine relevant keys
    Set myKeys = getPeerGroupNames();

    myKeys.retainAll(plugin.getPeerGroupNames());

    // Check for other peer groups
    for (Iterator it = myKeys.iterator(); it.hasNext();)
    {
      String next = (String) it.next();
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.