Package org.apache.commons.text.diff

# Class DeleteCommand<T>

java.lang.Object
org.apache.commons.text.diff.EditCommand<T>
org.apache.commons.text.diff.DeleteCommand<T>

Type Parameters:
  `T` - object type

public class DeleteCommand<T> extends EditCommand<T>
Command representing the deletion of one object of the first sequence.

When one object of the first sequence has no corresponding object 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 deletion 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

  Constructors
  Constructor
  Description
  `DeleteCommand(T object)`
  Constructs a new instance of `DeleteCommand`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(CommandVisitor<T> visitor)`
  Accepts a visitor.

  ### Methods inherited from class org.apache.commons.text.diff.EditCommand

  `getObject`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DeleteCommand

    public DeleteCommand(T object)
    Constructs a new instance of `DeleteCommand`.
    Parameters:
      `object` - the object of the first sequence that should be deleted

- ## Method Details

  - ### accept

    public void accept(CommandVisitor<T> visitor)
    Accepts a visitor. When a `DeleteCommand` accepts a visitor, it calls its `visitDeleteCommand` method.
    Specified by:
      `accept` in class `EditCommand<T>`
    Parameters:
      `visitor` - the visitor to be accepted