Class StringsComparator.Snake

java.lang.Object
org.apache.commons.text.diff.StringsComparator.Snake
Enclosing class:
StringsComparator

private static class StringsComparator.Snake extends Object
This class is a simple placeholder to hold the end part of a path under construction in a StringsComparator.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    Diagonal number.
    private final int
    End index.
    private final int
    Start index.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Snake(int start, int end, int diag)
    Constructs a new instance of Snake with specified indices.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the diagonal number of the snake.
    int
    Gets the end index of the snake.
    int
    Gets the start index of the snake.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • start

      private final int start
      Start index.
    • end

      private final int end
      End index.
    • diag

      private final int diag
      Diagonal number.
  • Constructor Details

    • Snake

      Snake(int start, int end, int diag)
      Constructs a new instance of Snake with specified indices.
      Parameters:
      start - start index of the snake
      end - end index of the snake
      diag - diagonal number
  • Method Details

    • getDiag

      public int getDiag()
      Gets the diagonal number of the snake.
      Returns:
      diagonal number of the snake
    • getEnd

      public int getEnd()
      Gets the end index of the snake.
      Returns:
      end index of the snake
    • getStart

      public int getStart()
      Gets the start index of the snake.
      Returns:
      start index of the snake