de.tuebingen.uni.sfs.germanet.relatedness
Class PathNode

java.lang.Object
  extended by de.tuebingen.uni.sfs.germanet.relatedness.PathNode
All Implemented Interfaces:
java.lang.Comparable<PathNode>

public class PathNode
extends java.lang.Object
implements java.lang.Comparable<PathNode>

Represents a node in the path from one node to the root. As such, it holds the synset and a counter (distance to the starting point, below).


Field Summary
 int index
           
 de.tuebingen.uni.sfs.germanet.api.Synset synset
           
 
Constructor Summary
PathNode(de.tuebingen.uni.sfs.germanet.api.Synset s)
          Constructor taking a synset; sets starting index to 1.
PathNode(de.tuebingen.uni.sfs.germanet.api.Synset s, int i)
          Constructor taking a synset and staring index.
 
Method Summary
 int compareTo(PathNode pn)
          Makes this object comparable.
 boolean equals(PathNode pn)
          Equals method designed towards testing equality on the path.
 java.lang.String toString()
          String representation of this PathNode object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

synset

public final de.tuebingen.uni.sfs.germanet.api.Synset synset

index

public final int index
Constructor Detail

PathNode

public PathNode(de.tuebingen.uni.sfs.germanet.api.Synset s,
                int i)
Constructor taking a synset and staring index.

Parameters:
s - This synset.
i - distance to the starting point (below)

PathNode

public PathNode(de.tuebingen.uni.sfs.germanet.api.Synset s)
Constructor taking a synset; sets starting index to 1.

Parameters:
s - This synset.
Method Detail

equals

public boolean equals(PathNode pn)
Equals method designed towards testing equality on the path. Two PathNodes are only equal if their distance from the starting point is also the same, not only the synset they carry.

Parameters:
pn - other PathNode.
Returns:
true if same synset at same point in path

toString

public java.lang.String toString()
String representation of this PathNode object. The String contains synset and index (position on the path).

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this PathNode object

compareTo

public int compareTo(PathNode pn)
Makes this object comparable.

Specified by:
compareTo in interface java.lang.Comparable<PathNode>
Parameters:
pn - other PathNode object
Returns:
-1 if index is less, 0 if equal, 1 if greater than index of other PathNode