asd
Class ASDPhraseNode

java.lang.Object
  extended by asd.ASDPhraseNode
All Implemented Interfaces:
java.lang.Cloneable

public class ASDPhraseNode
extends java.lang.Object
implements java.lang.Cloneable

Instances are nodes in an ASD phrase structure, which results from a partial or complete parse of a given phrase.

Author:
James A. Mason

Constructor Summary
ASDPhraseNode()
          Initializes an ASDPhraseNode with empty word and null fields.
 
Method Summary
protected  java.lang.Object clone()
           
 ASDGrammarNode instance()
          Returns the ASDGrammarNode that this ASDPhraseNode matched in an ASDGrammar; null if there is no match yet.
 ASDPhraseNode nextNode()
          Returns the next ASDPhraseNode (if any) in the subphrase to which this node belongs; null if there is no next node.
 void showTree(ASDPhraseNode currentNode)
          Displays to System.out the tree rooted at the receiver, with node currentNode indicated by an asterisk and an arrow.
 ASDPhraseNode subphrase()
          Returns the first ASDPhraseNode in the subphrase (if any) that this ASDPhraseNode represents; null if there is no subphrase.
 java.lang.Object value()
          Returns the semantic value for this node; null if none.
 java.lang.String word()
          Returns the vocabulary element in this node.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASDPhraseNode

public ASDPhraseNode()
Initializes an ASDPhraseNode with empty word and null fields.

Method Detail

instance

public ASDGrammarNode instance()
Returns the ASDGrammarNode that this ASDPhraseNode matched in an ASDGrammar; null if there is no match yet.


nextNode

public ASDPhraseNode nextNode()
Returns the next ASDPhraseNode (if any) in the subphrase to which this node belongs; null if there is no next node.


subphrase

public ASDPhraseNode subphrase()
Returns the first ASDPhraseNode in the subphrase (if any) that this ASDPhraseNode represents; null if there is no subphrase.


value

public java.lang.Object value()
Returns the semantic value for this node; null if none.


word

public java.lang.String word()
Returns the vocabulary element in this node.


clone

protected java.lang.Object clone()
Overrides:
clone in class java.lang.Object

showTree

public void showTree(ASDPhraseNode currentNode)
Displays to System.out the tree rooted at the receiver, with node currentNode indicated by an asterisk and an arrow.

Parameters:
currentNode - the current node at the top level in the phrase structure