Class EditCommand<T>
- java.lang.Object
 - 
- org.apache.commons.collections4.sequence.EditCommand<T>
 
 
- 
- Direct Known Subclasses:
 DeleteCommand,InsertCommand,KeepCommand
public abstract class EditCommand<T> extends java.lang.ObjectAbstract base class for all commands used to transform an objects sequence into another one.When two objects sequences are compared through the
SequencesComparator.getScriptmethod, the result is provided has ascriptcontaining the commands that progressively transform the first sequence into the second one.There are only three types of commands, all of which are subclasses of this abstract class. Each command is associated with one object belonging to at least one of the sequences. These commands are
InsertCommandwhich correspond to an object of the second sequence being inserted into the first sequence,DeleteCommandwhich correspond to an object of the first sequence being removed andKeepCommandwhich correspond to an object of the first sequence whichequalsan object in the second sequence. It is guaranteed that comparison is always performed this way (i.e. theequalsmethod of the object from the first sequence is used and the object passed as an argument comes from the second sequence) ; this can be important if subclassing is used for some elements in the first sequence and theequalsmethod is specialized.- Since:
 - 4.0
 - See Also:
 SequencesComparator,EditScript
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidaccept(CommandVisitor<T> visitor)Accept a visitor. 
 - 
 
- 
- 
Method Detail
- 
accept
public abstract void accept(CommandVisitor<T> visitor)
Accept a visitor.This method is invoked for each commands belonging to an
EditScript, in order to implement the visitor design pattern- Parameters:
 visitor- the visitor to be accepted
 
 - 
 
 -