Class LineGraphExport
java.lang.Object
org.variantsync.diffdetective.variation.diff.serialize.LineGraphExport
Class that contains functions for writing
CommitDiff
s and (sets of) VariationDiff
s to a linegraph file.- Author:
- Paul Bittner, Kevin Jedelhauser
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AnalysisResult.ResultKey<LineGraphExport.Statistic>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static String
private static String
lineGraphHeader
(VariationDiffSource source, LineGraphExportOptions<?> options) Produces the final linegraph file content.static <L extends Label>
LineGraphExport.StatistictoLineGraphFormat
(Iterable<VariationDiff<L>> trees, LineGraphExportOptions<? super L> options, OutputStream destination) Exports the given VariationDiffs that originated from a repository with the given name.static LineGraphExport.Statistic
toLineGraphFormat
(CommitDiff commitDiff, LineGraphExportOptions<? super DiffLinesLabel> options, OutputStream destination) Writes the given commitDiff in linegraph format to the given StringBuilder.static LineGraphExport.Statistic
toLineGraphFormat
(PatchDiff patch, LineGraphExportOptions<? super DiffLinesLabel> options, OutputStream destination) Writes the given patch in linegraph format to the given StringBuilder.static <L extends Label>
VariationDiffSerializeDebugDatatoLineGraphFormat
(VariationDiff<? extends L> variationDiff, LineGraphExportOptions<? super L> options, OutputStream destination) Exports the given VariationDiff to a linegraph String.
-
Field Details
-
STATISTIC
-
-
Constructor Details
-
LineGraphExport
private LineGraphExport()
-
-
Method Details
-
toLineGraphFormat
public static <L extends Label> VariationDiffSerializeDebugData toLineGraphFormat(VariationDiff<? extends L> variationDiff, LineGraphExportOptions<? super L> options, OutputStream destination) throws IOException Exports the given VariationDiff to a linegraph String. No file will be written.- Parameters:
variationDiff
- The variation diff to export to linegraph format.options
- Configuration options for the export, such as the format used for node and edge labels.- Returns:
- A pair holding some debug information and the produced linegraph as a string.
- Throws:
IOException
-
toLineGraphFormat
public static <L extends Label> LineGraphExport.Statistic toLineGraphFormat(Iterable<VariationDiff<L>> trees, LineGraphExportOptions<? super L> options, OutputStream destination) throws IOException Exports the given VariationDiffs that originated from a repository with the given name.- Parameters:
trees
- The set of trees to export.options
- Configuration options for the export, such as the format used for node and edge labels.- Returns:
- A pair of (1) metadata about the exported VariationDiffs, and (2) the produced linegraph as String.
- Throws:
IOException
-
toLineGraphFormat
public static LineGraphExport.Statistic toLineGraphFormat(CommitDiff commitDiff, LineGraphExportOptions<? super DiffLinesLabel> options, OutputStream destination) throws IOException Writes the given commitDiff in linegraph format to the given StringBuilder.- Parameters:
commitDiff
- The diff to convert to line graph format.options
- Configuration options for the export, such as the format used for node and edge labels.destination
- where the resulting line graph is written- Returns:
- The number of the next diff tree to export (updated value of treeCounter).
- Throws:
IOException
-
toLineGraphFormat
public static LineGraphExport.Statistic toLineGraphFormat(PatchDiff patch, LineGraphExportOptions<? super DiffLinesLabel> options, OutputStream destination) throws IOException Writes the given patch in linegraph format to the given StringBuilder.- Parameters:
patch
- The diff to convert to line graph format.options
- Configuration options for the export, such as the format used for node and edge labels.destination
- where the resulting line graph is written- Returns:
- The number of the next diff tree to export (updated value of treeCounter).
- Throws:
IOException
-
lineGraphHeader
private static String lineGraphHeader(VariationDiffSource source, LineGraphExportOptions<?> options) Produces the final linegraph file content. Creates a linegraph header from the given VariationDiffSource using theLineGraphExportOptions.treeFormat()
in the given options. Then appends the already created file content for nodes and edges.- Parameters:
source
- TheVariationDiffSource
that describes where the VariationDiff whose content is written to the file originated from.options
-LineGraphExportOptions
used to determine the treeFormat for the header.
-