Package com.google.collide.dto

Examples of com.google.collide.dto.CodeBlockAssociation


      final JsonArray<CodeGraphProposalImpl> zeroBoundary,
      JsonArray<CodeGraphProposalImpl> epsilonBoundary, JsonStringSet visited) {
    visited.add(getFullId(fileData, root));
    final JsonArray<CodeBlockAssociation> queue = fileData.getOutgoingLinks(root).copy();
    while (!queue.isEmpty()) {
      CodeBlockAssociation link = queue.splice(0, 1).pop();
      FileIndex targetFileData = fileIdToData.get(link.getTargetFileId());
      if (targetFileData == null) {
        continue;
      }
      CodeBlock targetCodeBlock = targetFileData.findCodeBlock(link.getTargetLocalId());
      if (targetCodeBlock == null) {
        continue;
      }

      final String targetFqname = targetFileData.getFqname(targetCodeBlock);
      if (targetFqname == null) {
        if (targetCodeBlock.getBlockType() != CodeBlock.Type.VALUE_FILE) {
          throw new IllegalStateException(
              "type=" + CodeBlock.Type.valueOf(targetCodeBlock.getBlockType()));
        }
        continue;
      }

      String fullTargetId = getFullId(targetFileData, targetCodeBlock);
      if (visited.contains(fullTargetId)) {
        continue;
      }
      visited.add(fullTargetId);


      // We have found a CodeBlock which is a target of the concrete link.
      // We want to match children of this code block against the query,
      // but the problem is that the children may be defined in another file
      // or can even be spread over many files (which is the case in JS where
      // one can add a method to Document.prototype from anywhere).
      // So we need to run a tree query to find all code blocks with the
      // same fqname (called representatives below).
      if (link.getIsRootAssociation()) {
        epsilonBoundary.add(new CodeGraphProposalImpl(
            targetCodeBlock, targetFqname, targetFileData));
      } else {
        final JsonArray<CodeGraphProposalImpl> fqnameRepresentatives =
            JsonCollections.createArray();
View Full Code Here


  private void collectOutgoingLinks(JsonArray<? extends CodeBlockAssociation> links) {
    if (links == null) {
      return;
    }
    for (int i = 0, size = links.size(); i < size; i++) {
      CodeBlockAssociation link = links.get(i);
      FileIndex fileData = fileIdToData.get(link.getSourceFileId());
      if (fileData != null) {
        fileData.addOutgoingLink(link);
      }
    }
    links.clear();
View Full Code Here

TOP

Related Classes of com.google.collide.dto.CodeBlockAssociation

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.