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

public Class KeepCommand<T>

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

Command representing the keeping of one object present in both sequences.

When one object of the first sequence equals another objects in the second 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 keeping of this object. The objects embedded in these type of commands always come from the first sequence.

Since
1.0
See Also
StringsComparator, EditScript

Constructor Summary

AccessConstructor and Description
public
KeepCommand(final T
the object belonging to both sequences (the object is a reference to the instance in the first sequence which is known to be equal to an instance in the second sequence)
object
)

Constructs a new instance of KeepCommand.

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

KeepCommandback to summary
public KeepCommand(final T object)

Constructs a new instance of KeepCommand.

Parameters
object:T

the object belonging to both sequences (the object is a reference to the instance in the first sequence which is known to be equal to an instance in the second sequence)

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 a KeepCommand accepts a visitor, it calls its visitKeepCommand method.

Parameters
visitor:CommandVisitor<T>

the visitor to be accepted.

Annotations
@Override