Package org.openjgraph.model.adjacencymatrix

Examples of org.openjgraph.model.adjacencymatrix.AdjacencyMatrixVertex


     * Test of getEdges method, of class AdjacencyMatrixVertex.
     */
    public void testGetEdges1() {
        try {
            AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
            AdjacencyMatrixVertex v1 = new AdjacencyMatrixVertex(graph, "A");
            AdjacencyMatrixVertex v2 = new AdjacencyMatrixVertex(graph, "B");
            AdjacencyMatrixVertex v3 = new AdjacencyMatrixVertex(graph, "C");
            AdjacencyMatrixVertex v4 = new AdjacencyMatrixVertex(graph, "D");
            graph.addVertex("A");
            graph.addVertex("B");
            graph.addVertex("C");
            graph.addVertex("D");
            graph.addEdge("A", "B");
View Full Code Here


    /**
     * Test of getId method, of class AdjacencyMatrixVertex.
     */
    public void testGetId() {
        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
        AdjacencyMatrixVertex vertex = new AdjacencyMatrixVertex(graph, "id");

        assertEquals("id", vertex.getId());
    }
View Full Code Here

    /**
     * Test of toString method, of class AdjacencyMatrixVertex.
     */
    public void testToString() {
        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
        AdjacencyMatrixVertex vertex = new AdjacencyMatrixVertex(graph, "id");

        assertEquals("id", vertex.toString());
    }
View Full Code Here

    /**
     * Test of equals method, of class AdjacencyMatrixVertex.
     */
    public void testEquals() {
        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
        AdjacencyMatrixVertex v1 = new AdjacencyMatrixVertex(graph, "id");
        AdjacencyMatrixVertex v2 = new AdjacencyMatrixVertex(graph, "id");
        AdjacencyMatrixVertex v3 = new AdjacencyMatrixVertex(graph, "id2");
        AdjacencyMatrixVertex v4 = new AdjacencyMatrixVertex(graph, null);
        AdjacencyMatrixVertex v5 = new AdjacencyMatrixVertex(graph, null);

        assertTrue(v1.equals(v2));
        assertTrue(v2.equals(v1));
        assertFalse(v1.equals(v3));
        assertFalse(v2.equals(v3));
View Full Code Here

     * Test of hashCode method, of class AdjacencyMatrixVertex.
     */
    public void testHashCode() {

        AdjacencyMatrixGraph graph = new AdjacencyMatrixGraph();
        AdjacencyMatrixVertex v1 = new AdjacencyMatrixVertex(graph, "id");
        AdjacencyMatrixVertex v2 = new AdjacencyMatrixVertex(graph, "id");
        AdjacencyMatrixVertex v3 = new AdjacencyMatrixVertex(graph, "id2");
        AdjacencyMatrixVertex v4 = new AdjacencyMatrixVertex(graph, null);
        AdjacencyMatrixVertex v5 = new AdjacencyMatrixVertex(graph, null);

        assertTrue(v1.hashCode() == v2.hashCode());
        assertFalse(v1.hashCode() == v3.hashCode());
        assertFalse(v2.hashCode() == v3.hashCode());
        assertFalse(v1.hashCode() == v4.hashCode());
        assertTrue(v5.hashCode() == v4.hashCode());
    }
View Full Code Here

TOP

Related Classes of org.openjgraph.model.adjacencymatrix.AdjacencyMatrixVertex

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.