Package classycle.graph

Examples of classycle.graph.AtomicVertex


    // Add arces to vertices
    for (int i = 0; i < unresolvedNodes.length; i++)
    {
      UnresolvedNode node = unresolvedNodes[i];
      String name = normalize(node.getAttributes().getName(), mergeInnerClasses);
      AtomicVertex vertex = (AtomicVertex) vertices.get(name);
      for (Iterator iterator = node.linkIterator(); iterator.hasNext();)
      {
        name = normalize((String) iterator.next(), mergeInnerClasses);
        AtomicVertex head = (AtomicVertex) vertices.get(name);
        if (head == null)
        {
          head = new AtomicVertex(ClassAttributes.createUnknownClass(name, 0));
          vertices.put(name, head);
        }
        if (vertex != head)
        {
          vertex.addOutgoingArcTo(head);
View Full Code Here


      ClassAttributes attributes = unresolvedNodes[i].getAttributes();
      String type = attributes.getType();
      String originalName = attributes.getName();
      int size = attributes.getSize();
      String name = normalize(originalName, mergeInnerClasses);
      AtomicVertex vertex = (AtomicVertex) vertices.get(name);
      if (vertex != null)
      {
        ClassAttributes vertexAttributes
                              = (ClassAttributes) vertex.getAttributes();
        size += vertexAttributes.getSize();
        if (name.equals(originalName) == false)
        {
          type = vertexAttributes.getType();
        }
        attributes.addSourcesOf(vertexAttributes);
      }
      ClassAttributes newAttributes = new ClassAttributes(name, null, type, size);
      newAttributes.addSourcesOf(attributes);
      vertex = new AtomicVertex(newAttributes);
      vertices.put(name, vertex);
    }
    return vertices;
  }
View Full Code Here

    Iterator vertices = _packageVertices.values().iterator();
    ArrayList list = new ArrayList();
   
    while (vertices.hasNext())
    {
      AtomicVertex vertex = (AtomicVertex) vertices.next();
      if (vertex.isGraphVertex())
      {
        list.add(vertex);
      }
    }
    _packageGraph = (AtomicVertex[]) list.toArray(new AtomicVertex[list.size()]);
View Full Code Here

        buffer.append(" contains ").append(numberOfVertices);
        buffer.append(' ').append(_packageCycle ? "packages" : "classes").append(':');
        for (int i = 0; i < numberOfVertices; i++)
        {
          buffer.append("\n    ");
          AtomicVertex vertex = component.getVertex(i);
          buffer.append(((NameAttributes) vertex.getAttributes()).getName());
        }
      }
    }
    return new String(buffer.append('\n'));
  }
View Full Code Here

    AtomicVertex[] graph = getClassGraph();
    HashSet usedClasses = new HashSet();
    int result = 0;
    for (int i = 0; i < graph.length; i++)
    {
      AtomicVertex vertex = graph[i];
      for (int j = 0, n = vertex.getNumberOfOutgoingArcs(); j < n; j++)
      {
        ClassAttributes attributes =
            (ClassAttributes) vertex.getHeadVertex(j).getAttributes();
        if (attributes.getType() == ClassAttributes.UNKNOWN)
        {
          if (!usedClasses.contains(attributes.getName()))
          {
            result++;
View Full Code Here

  public void printRaw(PrintWriter writer)
  {
    AtomicVertex[] graph = getClassGraph();
    for (int i = 0; i < graph.length; i++)
    {
      AtomicVertex vertex = graph[i];
      writer.println(vertex.getAttributes());
      for (int j = 0, n = vertex.getNumberOfOutgoingArcs(); j < n; j++)
      {
        writer.println("    " + vertex.getHeadVertex(j).getAttributes());
      }
    }
    writer.close();
  }
View Full Code Here

          Map layerMap, AtomicVertexRenderer renderer, PrintWriter writer
  {
    List list = getTrueCycles(cycles);
    for (int i = 0; i < graph.length; i++)
    {
      AtomicVertex vertex = graph[i];
      Integer layerIndex = (Integer) layerMap.get(vertex);
      writer.print(renderer.render(vertex,
                         getCycleFor(vertex, list),
                         layerIndex == null ? -1 : layerIndex.intValue()));
    }
View Full Code Here

    GraphAttributes ga = (GraphAttributes) component.getAttributes();
    Vertex fragmenter = ga.getBestFragmenters()[0];
    String result = ((NameAttributes) fragmenter.getAttributes()).getName();
    //String result = component.getVertex(0).getAttributes().toString();
    if (component.getNumberOfVertices() > 1) {
      AtomicVertex vertex = component.getVertex(0);
      NameAttributes attributes = (NameAttributes) vertex.getAttributes();
      String outerClass = attributes.getName();
      int index = outerClass.indexOf('$');
      if (index > 0) {
        outerClass = outerClass.substring(0, index);
      }
      boolean isInnerClass = true;
      for (int i = 0, n = component.getNumberOfVertices(); i < n; i++) {
        attributes = (NameAttributes) component.getVertex(i).getAttributes();
        if (attributes.getName().equals(outerClass)) {
          vertex = component.getVertex(i);
        } else if (!attributes.getName().startsWith(outerClass)
            || attributes.getName().charAt(outerClass.length()) != '$') {
          isInnerClass = false;
          break;
        }
      }
      attributes = (NameAttributes) vertex.getAttributes();
      if (isInnerClass) {
        result = attributes.getName() + " and inner classes";
      } else {
        result += " et al.";
      }
View Full Code Here

TOP

Related Classes of classycle.graph.AtomicVertex

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.