Class PathNode

java.lang.Object
org.assertj.core.util.diff.myers.PathNode
Direct Known Subclasses:
DiffNode, Snake

public abstract class PathNode extends Object
Copy from https://code.google.com/p/java-diff-utils/.

A node in a diffpath.

Author:
Juanco Anez
See Also:
  • Field Details

    • i

      public final int i
      Position in the original sequence.
    • j

      public final int j
      Position in the revised sequence.
    • prev

      public final PathNode prev
      The previous node in the path.
  • Constructor Details

    • PathNode

      public PathNode(int i, int j, PathNode prev)
      Concatenates a new path node with an existing diffpath.
      Parameters:
      i - The position in the original sequence for the new node.
      j - The position in the revised sequence for the new node.
      prev - The previous node in the path.
  • Method Details

    • isSnake

      public abstract boolean isSnake()
      Is this node a Snake node?
      Returns:
      true if this is a Snake node
    • isBootstrap

      public boolean isBootstrap()
      Is this a bootstrap node?

      In bootstrap nodes one of the two coordinates is less than zero.

      Returns:
      tru if this is a bootstrap node.
    • previousSnake

      public final PathNode previousSnake()
      Skips sequences of DiffNodes until a Snake or bootstrap node is found, or the end of the path is reached.
      Returns:
      The next first Snake or bootstrap node in the path, or null if none found.
    • toString

      public String toString()
      Overrides:
      toString in class Object