wicket.util.diff.myers
Class PathNode

java.lang.Object
  extended by wicket.util.diff.myers.PathNode
Direct Known Subclasses:
DiffNode, Snake

public abstract class PathNode
extends java.lang.Object

A node in a diffpath.

Version:
$Revision: 1.1 $ $Date: 2006/03/12 00:24:21 $
Author:
Juanco Anez
See Also:
DiffNode, Snake

Field Summary
 int i
          Position in the original sequence.
 int j
          Position in the revised sequence.
 PathNode prev
          The previous node in the path.
 
Constructor Summary
PathNode(int i, int j, PathNode prev)
          Concatenates a new path node with an existing diffpath.
 
Method Summary
 boolean isBootstrap()
          Is this a bootstrap node?
abstract  boolean isSnake()
          Is this node a Snake node?
 PathNode previousSnake()
          Skips sequences of DiffNodes until a Snake or bootstrap node is found, or the end of the path is reached.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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 Detail

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 Detail

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 bottstrap nodes one of the two corrdinates 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 java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2004-2007 Wicket developers. All Rights Reserved.