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
Fields Modifier and Type Field Description private java.util.MapmyGeneratorsCachestatic java.lang.StringTYPE-
Fields 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 Modifier Constructor Description privateQDiffNormalGenerator()privateQDiffNormalGenerator(java.util.Map properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadd(int addAt, int addStart, int addEnd, QSequenceLineCache addLines, java.lang.String encoding, java.io.Writer output)Handles the addition of lines to source.protected voidchange(int replaceStart, int replaceEnd, QSequenceLineCache replaceLines, int replaceWithStart, int replaceWithEnd, QSequenceLineCache replaceWithLines, java.lang.String encoding, java.io.Writer output)Handles a change of a range of lines in target to a range of lines in source.QDiffGeneratorcreateGenerator(java.util.Map properties)protected voiddelete(int deleteAt, int deleteStart, int deleteEnd, QSequenceLineCache deleteLines, java.lang.String encoding, java.io.Writer output)Handles a delete of lines from the target.protected java.lang.StringdisplayWhiteSpace(java.lang.String s)voidgenerateDiffHeader(java.lang.String item, java.lang.String leftInfo, java.lang.String rightInfo, java.io.Writer output)protected voidprocessBlock(int sourceStartLine, int sourceEndLine, QSequenceLineCache sourceLines, int targetStartLine, int targetEndLine, QSequenceLineCache targetLines, java.lang.String encoding, java.io.Writer output)protected voidprocessBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, java.io.OutputStream output)protected voidprocessBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, java.lang.String encoding, java.io.Writer output)static voidsetup()-
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 Detail
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
myGeneratorsCache
private java.util.Map myGeneratorsCache
-
-
Method Detail
-
setup
public static void setup()
-
generateDiffHeader
public void generateDiffHeader(java.lang.String item, java.lang.String leftInfo, java.lang.String rightInfo, java.io.Writer output) throws java.io.IOException- Specified by:
generateDiffHeaderin interfaceQDiffGenerator- Throws:
java.io.IOException
-
processBlock
protected void processBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, java.lang.String encoding, java.io.Writer output) throws java.io.IOException
- Specified by:
processBlockin classQDiffSequenceGenerator- Throws:
java.io.IOException
-
processBlock
protected void processBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines, java.io.OutputStream output) throws java.io.IOException
- Specified by:
processBlockin classQDiffSequenceGenerator- Throws:
java.io.IOException
-
createGenerator
public QDiffGenerator createGenerator(java.util.Map properties)
- Specified by:
createGeneratorin interfaceQDiffGeneratorFactory
-
processBlock
protected void processBlock(int sourceStartLine, int sourceEndLine, QSequenceLineCache sourceLines, int targetStartLine, int targetEndLine, QSequenceLineCache targetLines, java.lang.String encoding, java.io.Writer output) throws java.io.IOException- Throws:
java.io.IOException
-
displayWhiteSpace
protected java.lang.String displayWhiteSpace(java.lang.String s)
-
delete
protected void delete(int deleteAt, int deleteStart, int deleteEnd, QSequenceLineCache deleteLines, java.lang.String encoding, java.io.Writer output) throws java.io.IOExceptionHandles 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 withdeleteStartanddeleteEndto identify the deleted lines.- Throws:
java.io.IOException
-
add
protected void add(int addAt, int addStart, int addEnd, QSequenceLineCache addLines, java.lang.String encoding, java.io.Writer output) throws java.io.IOExceptionHandles 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 withaddStartandaddEndto identify the added lines.- Throws:
java.io.IOException
-
change
protected void change(int replaceStart, int replaceEnd, QSequenceLineCache replaceLines, int replaceWithStart, int replaceWithEnd, QSequenceLineCache replaceWithLines, java.lang.String encoding, java.io.Writer output) throws java.io.IOExceptionHandles 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:
java.io.IOException
-
-