Package org.sonar.graph

Examples of org.sonar.graph.DsmCell


    }
    json.append("}");
  }

  private void serializeCell(int y, int x) {
    DsmCell cell = dsm.getCell(x, y);
    json.append('{');
    if (cell.getEdge() != null && cell.getWeight() > 0) {
      json.append("\"i\":");
      json.append(dependencyIndex.get(cell.getEdge()).getId());
      json.append(",\"w\":");
      json.append(cell.getWeight());
    }
    json.append('}');
  }
View Full Code Here


    }
    json.append("}");
  }

  private void serializeCell(int y, int x) {
    DsmCell cell = dsm.cell(x, y);
    json.append('{');
    if (cell != null && cell.getEdge() != null && cell.getWeight() > 0) {
      Dependency dep = (Dependency) cell.getEdge();
      json.append("\"i\":");
      json.append(dep.getId());
      json.append(",\"w\":");
      json.append(cell.getWeight());
    }
    json.append('}');
  }
View Full Code Here

    assertEquals("A", dsm.getVertex(0).toString());
    assertEquals("B", dsm.getVertex(1).toString());

    assertEquals(2, dsm.getDimension());

    DsmCell ba = dsm.getCell(1, 0);
    assertEquals(1, ba.getWeight());
    assertTrue(ba.isFeedbackEdge());

    DsmCell ab = dsm.getCell(0, 1);
    assertEquals(3, ab.getWeight());
    assertFalse(ab.isFeedbackEdge());

    assertEquals(0, dsm.getCell(1, 1).getWeight());
  }
View Full Code Here

TOP

Related Classes of org.sonar.graph.DsmCell

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.