Package java.util

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


     */
    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

        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

        for (int i = 0; i < actions.size(); i++) {
            MultiIndex.Action a = (MultiIndex.Action) actions.get(i);
            if (a.getType() == MultiIndex.Action.TYPE_COMMIT) {
                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;
                } else {
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

  public static String[] getDifference(String oldValue, String newValue) {
    Set oldSet= deserialize(oldValue);
    Set newSet= deserialize(newValue);
    Set intersection= new HashSet(oldSet);
    intersection.retainAll(newSet);
    oldSet.removeAll(intersection);
    newSet.removeAll(intersection);
    oldSet.addAll(newSet);
    return (String[]) oldSet.toArray(new String[oldSet.size()]);
  }
View Full Code Here

        public String getAttribute(String name) {
            if (EVTaskFilter.IS_INVALID.equals(name)) {
                Set tasks = new HashSet(includedTasks);
                Set currentTasks = ((EVTask) model.getRoot()).getDescendants();
                tasks.retainAll(currentTasks);
                if (tasks.isEmpty())
                    return "invalid";
            }

            return super.getAttribute(name);
View Full Code Here

        this.userName = userName;
    }

    public boolean isInOneOf(Set allowedPrincipals) {
        HashSet set = new HashSet(getPrincipals());
        set.retainAll(allowedPrincipals);
        return set.size()>0;
    }

    abstract public Set getPrincipals();
   
View Full Code Here

          for (int i = 0; i < cells.length; i++) {
            all.addAll(getPorts(cells[i]));
            all.add(cells[i]);
          }
          all.addAll(DefaultGraphModel.getEdges(graphModel, cells));
          all.retainAll(visibleSet);
          all.remove(null);
          return all.toArray();
        }
      }
    }
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.