Package com.google.devtools.depan.graph.basic

Examples of com.google.devtools.depan.graph.basic.MultipleDirectedRelationFinder


   * @return a {@link MultipleDirectedRelationFinder} representing the selected
   *         relationships and their direction.
   */
  public MultipleDirectedRelationFinder getRelationShips() {
    // get a set of relations
    MultipleDirectedRelationFinder finder =
        new MultipleDirectedRelationFinder();

    for (DirectedRelation relation : relationPickerContent.getObjects()) {
      finder.addRelation(relation.getRelation(),
          relation.matchForward(), relation.matchBackward());
    }
    return finder;
  }
View Full Code Here


   * a DirectedRelationFinder representing this class at a precise moment.
   *
   * @return a representation of this selector as a DirectedRelationFinder.
   */
  public DirectedRelationFinder getSelectedRelations() {
    MultipleDirectedRelationFinder finder =
        new MultipleDirectedRelationFinder();
    for (DirectedRelation relation : contentMap.values()) {
      finder.addOrReplaceRelation(relation.getRelation(),
          relation.matchForward(), relation.matchBackward());
    }
    return finder;
  }
View Full Code Here

  /**
   * Tests PathMatcherTerm.isRecursive()
   */
  public void testPathMatcherTermIsRecursive() {
    MultipleDirectedRelationFinder finder =
        new MultipleDirectedRelationFinder();
    // set the recursiveness to true
    RelationshipSetAdapter setAdapter =
        new RelationshipSetAdapter("Temporary", finder, relations);
    PathMatcherTerm term = new PathMatcherTerm(setAdapter, true, false);

View Full Code Here

  /**
   * Tests RelationshipSetMatcher.matchBackward(Relation) &
   * RelationshipSetMatcher.matchForward(Relation)
   */
  public void testRelationshipSetMatcherMatchBackwardForward() {
    MultipleDirectedRelationFinder original =
        new MultipleDirectedRelationFinder();

    original.addRelation(MockRelation.CALL, true, false);

    RelationshipSetAdapter relSetAdapter =
        new RelationshipSetAdapter("Temporary", original, relations);

    assertFalse("Must not match backward",
View Full Code Here

   * @param backward Whether backward relation is true.
   * @param expected The expected result.
   */
  private void assertMultipleDirectedRelationFinderToStringIsCorrect(
      Relation relation, boolean forward, boolean backward, String expected) {
    MultipleDirectedRelationFinder original =
        new MultipleDirectedRelationFinder();
    original.addRelation(relation, forward, backward);

    assertEquals(expected, original.toString());
  }
View Full Code Here

  /**
   * Tests RelationshipSetMatcher.getDisplayName()
   */
  public void testRelationshipSetMatcherGetDisplayName() {
    String name = "Containers";
    MultipleDirectedRelationFinder multipleFinder =
        new MultipleDirectedRelationFinder();
    RelationshipSetAdapter setAdapter =
        new RelationshipSetAdapter(name, multipleFinder, relations);

    assertEquals(name, setAdapter.getDisplayName());
  }
View Full Code Here

   */
  public void testPathMatcherTermNextMatchNonRecursive() {
    GraphModel graph = new GraphModel();
    GraphNode[] nodes = fillGraphModel(graph);

    MultipleDirectedRelationFinder finder =
        new MultipleDirectedRelationFinder();

    finder.addRelation(MockRelation.DIRECTORY, true, false);

    // non-recursive
    RelationshipSetAdapter setAdapter =
        new RelationshipSetAdapter("Temporary", finder, relations);
    PathMatcherTerm term = new PathMatcherTerm(setAdapter, false, false);
View Full Code Here

   */
  public void testPathExpressionNextMatchRecursiveShort() {
    GraphModel graph = new GraphModel();
    GraphNode[] nodes = fillGraphModel(graph);

    MultipleDirectedRelationFinder finder =
        new MultipleDirectedRelationFinder();

    finder.addRelation(MockRelation.DIRECTORY, true, false);

    // make it recursive
    RelationshipSetAdapter relSetAdapter =
        new RelationshipSetAdapter("Temporary", finder, relations);
    PathMatcherTerm term = new PathMatcherTerm(relSetAdapter, true, false);
View Full Code Here

   * @return A new <code>PathExpression</code> with the given properties.
   */
  private PathExpression createPathExpression(boolean twoFiltersInFirstMatcher,
      boolean cumulativeSecondMatcher, boolean recursive) {
    PathExpression pathExpression = new PathExpression();
    MultipleDirectedRelationFinder finder;
    PathMatcherTerm term;

    finder = new MultipleDirectedRelationFinder();
    finder.addRelation(MockRelation.CLASSFILE, true, false);

    if (twoFiltersInFirstMatcher) {
      finder.addRelation(MockRelation.DIRECTORY, true, false);
    }

    RelationshipSetAdapter setAdapter =
        new RelationshipSetAdapter("Temporary", finder, relations);
    term = new PathMatcherTerm(setAdapter, recursive, false);
    pathExpression.addPathMatcher(term);

    finder = new MultipleDirectedRelationFinder();
    finder.addRelation(MockRelation.CLASS, true, false);
    // cumulative!
    setAdapter = new RelationshipSetAdapter("Temporary", finder, relations);
    term = new PathMatcherTerm(setAdapter, recursive, cumulativeSecondMatcher);
    pathExpression.addPathMatcher(term);
    return pathExpression;
View Full Code Here

    GraphNode srcNodes[] =
        TestUtils.buildComplete(testGraph, 5, SampleRelation.sampleRelation);

    assertGraphNodesEdges(testGraph, 5, 10);

    MultipleDirectedRelationFinder finder =
      new MultipleDirectedRelationFinder();
    finder.addRelation(SampleRelation.sampleRelation, true, false);
    TreeModel treeData = new HierarchicalTreeModel(
        testGraph.computeSuccessorHierarchy(finder));

    @SuppressWarnings("unused")
    Collection<CollapseData> collapseChanges =
View Full Code Here

TOP

Related Classes of com.google.devtools.depan.graph.basic.MultipleDirectedRelationFinder

Copyright © 2018 www.massapicom. 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.