Package de.regnis.q.sequence.line.diff
Class QDiffNormalGenerator
java.lang.Object
de.regnis.q.sequence.line.diff.QDiffSequenceGenerator
de.regnis.q.sequence.line.diff.QDiffNormalGenerator
- All Implemented Interfaces:
QDiffGenerator
,QDiffGeneratorFactory
public final class QDiffNormalGenerator
extends QDiffSequenceGenerator
implements QDiffGeneratorFactory
-
Field Summary
FieldsFields inherited from interface de.regnis.q.sequence.line.diff.QDiffGeneratorFactory
EOL_PROPERTY, GUTTER_PROPERTY, HUNK_DELIMITER, IGNORE_ALL_SPACE, IGNORE_EOL_PROPERTY, IGNORE_SPACE_CHANGE, IGNORE_SPACE_PROPERTY, WHITESPACE_PROPERTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
add
(int addAt, int addStart, int addEnd, QSequenceLineCache addLines, String encoding, Writer output) Handles the addition of lines to source.protected void
change
(int replaceStart, int replaceEnd, QSequenceLineCache replaceLines, int replaceWithStart, int replaceWithEnd, QSequenceLineCache replaceWithLines, String encoding, Writer output) Handles a change of a range of lines in target to a range of lines in source.createGenerator
(Map properties) protected void
delete
(int deleteAt, int deleteStart, int deleteEnd, QSequenceLineCache deleteLines, String encoding, Writer output) Handles a delete of lines from the target.protected String
void
generateDiffHeader
(String item, String leftInfo, String rightInfo, Writer output) protected void
processBlock
(int sourceStartLine, int sourceEndLine, QSequenceLineCache sourceLines, int targetStartLine, int targetEndLine, QSequenceLineCache targetLines, String encoding, Writer output) protected void
processBlock
(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, OutputStream output) protected void
processBlock
(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, String encoding, Writer output) static void
setup()
Methods inherited from class de.regnis.q.sequence.line.diff.QDiffSequenceGenerator
generateBinaryDiff, generateTextDiff, generateTextDiff, generateTextDiff, generateTextDiff, generateTextDiff, getEOL, getGutter, getHunkDelimiter, getProperties, getSimplifier, print, print, printLine, println, println, println, println
-
Field Details
-
TYPE
- See Also:
-
myGeneratorsCache
-
-
Constructor Details
-
QDiffNormalGenerator
-
QDiffNormalGenerator
private QDiffNormalGenerator()
-
-
Method Details
-
setup
public static void setup() -
generateDiffHeader
public void generateDiffHeader(String item, String leftInfo, String rightInfo, Writer output) throws IOException - Specified by:
generateDiffHeader
in interfaceQDiffGenerator
- Throws:
IOException
-
processBlock
protected void processBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, String encoding, Writer output) throws IOException - Specified by:
processBlock
in classQDiffSequenceGenerator
- Throws:
IOException
-
processBlock
protected void processBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, OutputStream output) throws IOException - Specified by:
processBlock
in classQDiffSequenceGenerator
- Throws:
IOException
-
createGenerator
- Specified by:
createGenerator
in interfaceQDiffGeneratorFactory
-
processBlock
protected void processBlock(int sourceStartLine, int sourceEndLine, QSequenceLineCache sourceLines, int targetStartLine, int targetEndLine, QSequenceLineCache targetLines, String encoding, Writer output) throws IOException - Throws:
IOException
-
displayWhiteSpace
-
delete
protected void delete(int deleteAt, int deleteStart, int deleteEnd, QSequenceLineCache deleteLines, String encoding, Writer output) throws IOException Handles a delete of lines from the target.- Parameters:
deleteAt
- the line where the lines would have appeared in the source (0 based)deleteStart
- first line deleted from target (0 based).deleteEnd
- last line deleted from target (0 based).deleteLines
- all the lines from the target file. Could be accessed withdeleteStart
anddeleteEnd
to identify the deleted lines.- Throws:
IOException
-
add
protected void add(int addAt, int addStart, int addEnd, QSequenceLineCache addLines, String encoding, Writer output) throws IOException Handles the addition of lines to source.- Parameters:
addAt
- the line where the new lines would be added to target (0 based)addStart
- the first line added from source (0 based)addEnd
- the last line added from source (0 based)addLines
- all the lines from the source file. Could be accessed withaddStart
andaddEnd
to identify the added lines.- Throws:
IOException
-
change
protected void change(int replaceStart, int replaceEnd, QSequenceLineCache replaceLines, int replaceWithStart, int replaceWithEnd, QSequenceLineCache replaceWithLines, String encoding, Writer output) throws IOException Handles a change of a range of lines in target to a range of lines in source.- Parameters:
replaceStart
- the first line in target that will be replaced (0 based)replaceEnd
- the last line in target that will be replaced (0 based)replaceLines
- all the lines in targetreplaceWithStart
- the first line in source to that will replace the lines in target (0 based)replaceWithEnd
- the last line in source to that will replace the lines in target (0 based)replaceWithLines
- all the lines in source- Throws:
IOException
-