/** * Get a list of traced links (i.e. links including the tracing status) * * @return list of traced links */ public List<TracedLink> getTracedLinks() { final List<TracedLink> tracedLinks = new ArrayList<>(); for (final Entry<LinkStatus, List<LinkedSpecificationItem>> entry : this.links.entrySet()) { for (final LinkedSpecificationItem other : entry.getValue()) { tracedLinks.add(new TracedLink(other, entry.getKey())); } } return tracedLinks; }
protected void renderLinkEntry(final List<TracedLink> outLinks, final String indentation) { for (final TracedLink link : outLinks) { final SpecificationItemId otherId = link.getOtherLinkEnd().getId(); this.stream.print(indentation); this.stream.print(" <li><a href=\"#"); this.stream.print(otherId); this.stream.print("\">"); this.stream.print(otherId); this.stream.print("</a>"); if (link.getStatus() != LinkStatus.COVERS && link.getStatus() != LinkStatus.COVERED_SHALLOW) { this.stream.print(" <em>(" + link.getStatus() + ")</em>"); } renderLinkOrigin(link); this.stream.println("</li>"); } }
private void renderLinkOrigin(final TracedLink link) { final String origin = OriginLinkFormatter .formatAsSpan(link.getOtherLinkEnd().getLocation()); if (!origin.isEmpty()) { this.stream.print(" "); this.stream.print(origin); } }
private void renderLinkOrigin(final TracedLink link) { final String origin = OriginLinkFormatter .formatAsSpan(link.getOtherLinkEnd().getLocation()); if (!origin.isEmpty()) { this.stream.print(" "); this.stream.print(origin); } }
protected void renderLinkEntry(final List<TracedLink> outLinks, final String indentation) { for (final TracedLink link : outLinks) { final SpecificationItemId otherId = link.getOtherLinkEnd().getId(); this.stream.print(indentation); this.stream.print(" <li><a href=\"#"); this.stream.print(otherId); this.stream.print("\">"); this.stream.print(otherId); this.stream.print("</a>"); if (link.getStatus() != LinkStatus.COVERS && link.getStatus() != LinkStatus.COVERED_SHALLOW) { this.stream.print(" <em>(" + link.getStatus() + ")</em>"); } renderLinkOrigin(link); this.stream.println("</li>"); } }
protected List<TracedLink> sortLinkStreamById(final Stream<TracedLink> tracedLinkStream) { return tracedLinkStream // .sorted((a, b) -> a.getOtherLinkEnd().getId().toString() .compareTo(b.getOtherLinkEnd().getId().toString())) // .collect(Collectors.toList()); }
/** * Get a list of traced links (i.e. links including the tracing status) * * @return list of traced links */ public List<TracedLink> getTracedLinks() { final List<TracedLink> tracedLinks = new ArrayList<>(); for (final Entry<LinkStatus, List<LinkedSpecificationItem>> entry : this.links.entrySet()) { for (final LinkedSpecificationItem other : entry.getValue()) { tracedLinks.add(new TracedLink(other, entry.getKey())); } } return tracedLinks; }
private void renderLink(final PrintStream report, final TracedLink link, final boolean showOrigin) { final LinkStatus status = link.getStatus(); report.print(status.isIncoming() ? "|<-- (" : "|--> ("); report.print(status.getShortTag()); report.print(") "); report.print(link.getOtherLinkEnd().getId()); report.print(this.settings.getNewline()); if (showOrigin) { final Location location = link.getOtherLinkEnd().getLocation(); if (location != null) { report.print("| "); renderOrigin(report, location); report.print(this.settings.getNewline()); } } }
protected List<TracedLink> sortLinkStreamById(final Stream<TracedLink> tracedLinkStream) { return tracedLinkStream // .sorted((a, b) -> a.getOtherLinkEnd().getId().toString() .compareTo(b.getOtherLinkEnd().getId().toString())) // .collect(Collectors.toList()); }
private void renderLink(final PrintStream report, final TracedLink link, final boolean showOrigin) { final LinkStatus status = link.getStatus(); report.print(status.isIncoming() ? "|<-- (" : "|--> ("); report.print(status.getShortTag()); report.print(") "); report.print(link.getOtherLinkEnd().getId()); report.print(this.settings.getNewline()); if (showOrigin) { final Location location = link.getOtherLinkEnd().getLocation(); if (location != null) { report.print("| "); renderOrigin(report, location); report.print(this.settings.getNewline()); } } }
private void renderOrderedLinks(final PrintStream report, final LinkedSpecificationItem item, final boolean showOrigin) { item.getTracedLinks() // .stream() // .sorted((a, b) -> a.getOtherLinkEnd().getId() .compareTo(b.getOtherLinkEnd().getId())) // .forEachOrdered(link -> renderLink(report, link, showOrigin)); }
private void renderOrderedLinks(final PrintStream report, final LinkedSpecificationItem item, final boolean showOrigin) { item.getTracedLinks() // .stream() // .sorted((a, b) -> a.getOtherLinkEnd().getId() .compareTo(b.getOtherLinkEnd().getId())) // .forEachOrdered(link -> renderLink(report, link, showOrigin)); }