KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > jrcs > diff > myers > DiffNode


1 package org.apache.commons.jrcs.diff.myers;
2
3 /**
4  * <p>Title: </p>
5  * <p>Description: </p>
6  * <p>Copyright: Copyright (c) 2002</p>
7  * <p>Company: </p>
8  * @author not attributable
9  * @version 1.0
10  */

11
12 /**
13  * A diffnode in a diffpath.
14  * <p>
15  * A DiffNode and its previous node mark a delta between
16  * two input sequences, that is, two differing subsequences
17  * between (possibly zero length) matching sequences.
18  *
19  * {@link DiffNode DiffNodes} and {@link Snake Snakes} allow for compression
20  * of diffpaths, as each snake is represented by a single {@link Snake Snake}
21  * node and each contiguous series of insertions and deletions is represented
22  * by a single {@link DiffNode DiffNodes}.
23  *
24  * @version $Revision: 1.1 $ $Date: 2004/10/06 09:47:23 $
25  * @author <a HREF="mailto:juanco@suigeneris.org">Juanco Anez</a>
26  *
27  */

28 public final class DiffNode
29     extends PathNode
30 {
31     /**
32      * Constructs a DiffNode.
33      * <p>
34      * DiffNodes are compressed. That means that
35      * the path pointed to by the <code>prev</code> parameter
36      * will be followed using {@link PathNode#previousSnake}
37      * until a non-diff node is found.
38      *
39      * @param the position in the original sequence
40      * @param the position in the revised sequence
41      * @param prev the previous node in the path.
42      */

43     public DiffNode(int i, int j, PathNode prev)
44     {
45         super(i, j, (prev == null ? null : prev.previousSnake()) );
46     }
47
48     /**
49      * {@inheritDoc}
50      * @return false, always
51      */

52     public boolean isSnake()
53     {
54         return false;
55     }
56
57 }
Popular Tags