Top Description Fields Constructors Methods
com.github.difflib.algorithm.myers

public final Class PathNode

extends Object
Class Inheritance

A node in a diffpath.
Author
Juanco Anez

Field Summary

Modifier and TypeField and Description
public final boolean
public final int
i

Position in the original sequence.

public final int
j

Position in the revised sequence.

public final PathNode
prev

The previous node in the path.

public final boolean

Constructor Summary

AccessConstructor and Description
public
PathNode(int
The position in the original sequence for the new node.
i
,
int
The position in the revised sequence for the new node.
j
,
boolean snake, boolean bootstrap, PathNode
The previous node in the path.
prev
)

Concatenates a new path node with an existing diffpath.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

tru if this is a bootstrap node.
isBootstrap
()

Is this a bootstrap node?

public boolean
public final PathNode

Returns:

The next first PathNode or bootstrap node in the path, or null if none found.
previousSnake
()

Skips sequences of PathNodes until a snake or bootstrap node is found, or the end of the path is reached.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bootstrapback to summary
public final boolean bootstrap
iback to summary
public final int i

Position in the original sequence.

jback to summary
public final int j

Position in the revised sequence.

prevback to summary
public final PathNode prev

The previous node in the path.

snakeback to summary
public final boolean snake

Constructor Detail

PathNodeback to summary
public PathNode(int i, int j, boolean snake, boolean bootstrap, PathNode prev)

Concatenates a new path node with an existing diffpath.

Parameters
i:int

The position in the original sequence for the new node.

j:int

The position in the revised sequence for the new node.

prev:PathNode

The previous node in the path.

Method Detail

isBootstrapback to summary
public boolean isBootstrap()

Is this a bootstrap node?

In bottstrap nodes one of the two corrdinates is less than zero.

Returns:boolean

tru if this is a bootstrap node.

isSnakeback to summary
public boolean isSnake()
previousSnakeback to summary
public final PathNode previousSnake()

Skips sequences of PathNodes until a snake or bootstrap node is found, or the end of the path is reached.

Returns:PathNode

The next first PathNode or bootstrap node in the path, or null if none found.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override