Top Description Constructors Methods
org.apache.commons.text.diff

public Class InsertCommand<T>

extends EditCommand<T>
Class Inheritance
Type Parameters
<T>
object type

Command representing the insertion of one object of the second sequence.

When one object of the second sequence has no corresponding object in the first sequence at the right place, the edit script transforming the first sequence into the second sequence uses an instance of this class to represent the insertion of this object. The objects embedded in these type of commands always come from the second sequence.

Since
1.0
See Also
StringsComparator, EditScript

Constructor Summary

AccessConstructor and Description
public
InsertCommand(final T
the object of the second sequence that should be inserted.
object
)

Constructs a new instance of InsertCommand.

Method Summary

Modifier and TypeMethod and Description
public void
accept(final CommandVisitor<T>
the visitor to be accepted.
visitor
)

Implements abstract org.apache.commons.text.diff.EditCommand.accept.

Accepts a visitor.

Inherited from org.apache.commons.text.diff.EditCommand:
getObject

Constructor Detail

InsertCommandback to summary
public InsertCommand(final T object)

Constructs a new instance of InsertCommand.

Parameters
object:T

the object of the second sequence that should be inserted.

Method Detail

acceptback to summary
public void accept(final CommandVisitor<T> visitor)

Implements abstract org.apache.commons.text.diff.EditCommand.accept.

Accepts a visitor. When an InsertCommand accepts a visitor, it calls its visitInsertCommand method.

Parameters
visitor:CommandVisitor<T>

the visitor to be accepted.

Annotations
@Override