public class ReplacementsFinder<T> extends java.lang.Object implements CommandVisitor<T>
The comparison of two objects sequences leads to the identification of common
parts and parts which only belong to the first or to the second sequence. The
common parts appear in the edit script in the form of keep commands,
they can be considered as synchronization objects between the two sequences.
These synchronization objects split the two sequences in synchronized
sub-sequences. The first sequence can be transformed into the second one by
replacing each synchronized sub-sequence of the first sequence by the
corresponding sub-sequence of the second sequence. This is a synthetic way to
edit script, replacing individual
insert commands by fewer replacements acting on
This class is devoted to perform this interpretation. It visits an
edit script (because it implements the
CommandVisitor interface) and calls a user-supplied
handler implementing the
interface to process the sub-sequences.
|Constructor and Description|
|Modifier and Type||Method and Description|
Add an object to the pending deletions set.
Add an object to the pending insertions set.
Handle a synchronization object.
public void visitInsertCommand(T object)
public void visitKeepCommand(T object)
When a synchronization object is identified, the pending insertions and pending deletions sets are provided to the user handler as subsequences.
Copyright © 2010 - 2020 Adobe. All Rights Reserved