Package java.util

Examples of java.util.Collection.retainAll()


                        Object oa = ((ObjectToken) a).getValue();
                        Object ob = ((ObjectToken) b).getValue();

                        if (oa instanceof Set && ob instanceof Collection) {
                            Set result = new HashSet((Set) oa);
                            result.retainAll((Collection) ob);
                            return new ObjectToken(result);
                        } else {
                            throw new InterpreterException(
                                    "Unknown object types: expected Set and Collection.");
                        }
View Full Code Here


                             "throws expected exception " + ex);
        }
       
        // method retainAll
        try {
            result.retainAll(instance5Collection);
            fail(ASSERTION_FAILED,
                 "Method retainAll called on a query result show throw " +
                 "UnsupportedOperationException");
        }
        catch (UnsupportedOperationException ex) {
View Full Code Here

                             "throws expected exception " + ex);
        }
       
        // method retainAll
        try {
            result.retainAll(instance5Collection);
            fail(ASSERTION_FAILED,
                 "Method retainAll called on a query result show throw " +
                 "UnsupportedOperationException");
        }
        catch (UnsupportedOperationException ex) {
View Full Code Here

        pw.println(outIn.format(names));
        showSetNames(pw, temp);

        temp.clear();
        temp.addAll(set1);
        temp.retainAll(set2);
        pw.println();
        pw.println(inIn.format(names));
        showSetNames(pw, temp);
    }
View Full Code Here

      final IJavaElement elem = (IJavaElement) it.next();
      if (elem.getElementType() == IJavaElement.FIELD)
        ret.add(elem);
    }

    ret.retainAll(this.fieldsToRefactor);
    return ret;
  }

  private String getFullyQualifiedName(IJavaElement elem) {
    // Get the associated set.
View Full Code Here

        Collection picked = vv.getPickedVertexState().getPicked();
        if(picked.size() == 2) {
          Pair pair = new Pair(picked);
          Graph graph = layout.getGraph();
          Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
          edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
          exclusions.addAll(edges);
          vv.repaint();
        }
       
      }});
View Full Code Here

        Collection picked = vv.getPickedVertexState().getPicked();
        if(picked.size() == 2) {
          Pair pair = new Pair(picked);
          Graph graph = layout.getGraph();
          Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
          edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
          exclusions.removeAll(edges);
          vv.repaint();
        }
       
      }});
View Full Code Here

        Collection picked = vv.getPickedVertexState().getPicked();
        if(picked.size() == 2) {
          Pair pair = new Pair(picked);
          Graph graph = layout.getGraph();
          Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
          edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
          exclusions.addAll(edges);
          vv.repaint();
        }
       
      }});
View Full Code Here

        Collection picked = vv.getPickedVertexState().getPicked();
        if(picked.size() == 2) {
          Pair pair = new Pair(picked);
          Graph graph = layout.getGraph();
          Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
          edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
          exclusions.removeAll(edges);
          vv.repaint();
        }
       
      }});
View Full Code Here

    "contains",
    "any", };
 
  boolean dumbHasRelation(Collection A, int filter, Collection B) {
    Collection ab = new TreeSet(A);
    ab.retainAll(B);
    if (ab.size() > 0 && (filter & SortedSetRelation.A_AND_B) == 0) return false;
   
    // A - B size == A.size - A&B.size
    if (A.size() > ab.size() && (filter & SortedSetRelation.A_NOT_B) == 0) return false;
   
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.