de.pado.dv
Class Node

java.lang.Object
  extended by de.pado.dv.Node

public class Node
extends java.lang.Object

This class models a Node. A node has a word and a part of speech. It can be in a graph, in which case it additionally has an index, but it does not have to.


Constructor Summary
Node(java.lang.String word, java.lang.String pos)
          Initialisation for a node without an index (word, POS)
Node(java.lang.String word, java.lang.String pos, java.lang.Integer index)
          Initialisation for a node with an index (word, POS, index)
 
Method Summary
 java.lang.Integer getIndex()
          Returns the index (if present).
 java.lang.String getPOS()
          Returns the part of speech
 java.lang.String getWord()
          Returns the word
 boolean matches(Node n)
          Two nodes match iff their words and parts of speech are equal, or if either is a wildcard ("*")
 java.lang.String toString()
          Returns a string representation of the Node object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(java.lang.String word,
            java.lang.String pos,
            java.lang.Integer index)
Initialisation for a node with an index (word, POS, index)


Node

public Node(java.lang.String word,
            java.lang.String pos)
Initialisation for a node without an index (word, POS)

Method Detail

getWord

public java.lang.String getWord()
Returns the word


getPOS

public java.lang.String getPOS()
Returns the part of speech


getIndex

public java.lang.Integer getIndex()
Returns the index (if present). If no index is present, a NullPointerException is thrown.


toString

public java.lang.String toString()
Returns a string representation of the Node object.

Overrides:
toString in class java.lang.Object

matches

public boolean matches(Node n)
Two nodes match iff their words and parts of speech are equal, or if either is a wildcard ("*")