Package de.schauderhaft.degraph.model

Examples of de.schauderhaft.degraph.model.SimpleNode


    this.typ = typ;
    return this;
  }

  public Node createSimpleNode() {
    Node simpleNode = new SimpleNode(typ, name);
    return simpleNode;
  }
View Full Code Here


import de.schauderhaft.degraph.model.Node;
import de.schauderhaft.degraph.model.SimpleNode;

public class ChessCategory implements Categorizer {
  public SimpleNode asNode(String s) {
    return new SimpleNode("chesspiece", s);
  }
View Full Code Here

import de.schauderhaft.degraph.model.SimpleNode;

public class JavaApiTest {
  private SimpleNode node(String s) {
    return new SimpleNode(s, s);
  }
View Full Code Here

  }

  @Test
  public void aGraphContainsTheNodesThatGetAddedToTheGraph() {
    JavaGraph graph = new JavaGraph();
    SimpleNode node = new SimpleNode("", "");
    graph.add(node);
    assertTrue(graph.topNodes().contains(node));
  }
View Full Code Here

  }

  @Test
  public void simpleNodesDontHaveConnections() {
    JavaGraph graph = new JavaGraph();
    SimpleNode node = new SimpleNode("", "");
    graph.add(node);

    assertEquals(new HashSet<>(), graph.connectionsOf(node));

  }
View Full Code Here

  }

  @Test
  public void connectionsOfANodeAreTheNodesItHasEdgesWith() {
    JavaGraph graph = new JavaGraph();
    SimpleNode a = node("a");
    SimpleNode b = node("b");
    graph.connect(a, b);

    assertEquals(new HashSet<>(asList(b)), graph.connectionsOf(a));
  }
View Full Code Here

  }

  @Test
  public void aSimpleNodeHasNoContenten() {
    JavaGraph graph = new JavaGraph();
    SimpleNode node = new SimpleNode("", "");
    graph.add(node);
    assertEquals(new HashSet<>(), graph.contentsOf(node));
  }
View Full Code Here

    assertEquals(new HashSet<>(), graph.contentsOf(node));
  }

  @Test
  public void categorizerGetsApplied() {
    JavaGraph graph = new JavaGraph(new ConstantCategorizer(new SimpleNode(
        "x", "x")));
    SimpleNode node = new SimpleNode("", "");
    graph.add(node);
    assertEquals(new HashSet<>(asList(node)),
        graph.contentsOf(new SimpleNode("x", "x")));
  }
View Full Code Here

TOP

Related Classes of de.schauderhaft.degraph.model.SimpleNode

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.