Class DiffLinesLabel
java.lang.Object
org.variantsync.diffdetective.variation.DiffLinesLabel
- All Implemented Interfaces:
Label
A label consisting of lines with
line number information for each line.
Using this label, a VariationDiff encodes all information (except the original line
ending encoding, i.e. LF vs CRLF) necessary to reconstruct the original files
and, when used during construction, the line diff between these files.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DiffLinesLabel.Line> private List<DiffLinesLabel.Line> -
Constructor Summary
ConstructorsConstructorDescriptionDiffLinesLabel(List<DiffLinesLabel.Line> lines) DiffLinesLabel(List<DiffLinesLabel.Line> lines, List<DiffLinesLabel.Line> trailingLines) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDiffLine(DiffLinesLabel.Line newLine) voidaddDiffLines(List<DiffLinesLabel.Line> newLines) clone()Creates a deep copy of this label.booleangetLines()Returns the lines which need to be printed before the children of a node.Returns the lines which need to be printed after the children of a node.private List<DiffLinesLabel.Line> mapWithoutTimeDependentState(List<DiffLinesLabel.Line> lines, Time time) static DiffLinesLabelofCodeBlock(String codeBlock) voidsetDiffTrailingLines(List<DiffLinesLabel.Line> newLines) toString()static DiffLinesLabelwithInvalidLineNumbers(List<String> lines) Returns a deep copy where the line numbers attimeare set toDiffLineNumber.InvalidLineNumber.withTimeDependentStateFrom(Label otherLabel, Time time) Returns a deep copy where the line numbers attimeare copied fromotherLabel.private static List<DiffLinesLabel.Line> zipWithTimeDependentStateFrom(List<DiffLinesLabel.Line> linesA, List<DiffLinesLabel.Line> linesB, Time time)
-
Field Details
-
lines
-
trailingLines
-
-
Constructor Details
-
DiffLinesLabel
public DiffLinesLabel() -
DiffLinesLabel
-
DiffLinesLabel
-
-
Method Details
-
withInvalidLineNumbers
-
ofCodeBlock
-
addDiffLine
-
addDiffLines
-
getDiffLines
-
setDiffTrailingLines
-
getDiffTrailingLines
-
getLines
Description copied from interface:LabelReturns the lines which need to be printed before the children of a node. Most lines associated with a node should be included in this list, for example,#ifs are stored here. -
getTrailingLines
Description copied from interface:LabelReturns the lines which need to be printed after the children of a node. For example,#endifs are stored as trailing lines.- Specified by:
getTrailingLinesin interfaceLabel
-
withoutTimeDependentState
Returns a deep copy where the line numbers attimeare set toDiffLineNumber.InvalidLineNumber.- Specified by:
withoutTimeDependentStatein interfaceLabel- See Also:
-
mapWithoutTimeDependentState
private List<DiffLinesLabel.Line> mapWithoutTimeDependentState(List<DiffLinesLabel.Line> lines, Time time) -
withTimeDependentStateFrom
Returns a deep copy where the line numbers attimeare copied fromotherLabel. The number of lines and their content must be identical inthisandotherLabel.- Specified by:
withTimeDependentStateFromin interfaceLabel- See Also:
-
zipWithTimeDependentStateFrom
private static List<DiffLinesLabel.Line> zipWithTimeDependentStateFrom(List<DiffLinesLabel.Line> linesA, List<DiffLinesLabel.Line> linesB, Time time) -
toString
-
clone
Description copied from interface:LabelCreates a deep copy of this label. -
equals
-