org.jscience.ml.tigerxml
Class Path

java.lang.Object
  extended by org.jscience.ml.tigerxml.Path

public class Path
extends java.lang.Object

Represents a path leading through the syntax tree that connects two nodes. To instantiate this class use #getPathToTop(GraphNodenode) or #makePath(GraphNodestart_node,GraphNodeend_node).


Field Summary
protected  boolean end_below_start
          DOCUMENT ME!
protected  boolean start_below_end
          DOCUMENT ME!
protected  java.util.ArrayList steps
          DOCUMENT ME!
protected  int verbosity
          The higher this value the more process and debug information will written to stderr.
 
Method Summary
 GraphNode getFirst()
          Returns the first GraphNode in this Path.
 GraphNode getLast()
          Returns the last GraphNode in this Path.
 GraphNode getNext()
          Returns the next GraphNode in this Path relative to the current position of this Path (iteration based method).
static Path getPathToTop(GraphNode node)
          This static method creates a path leading from the input node to the root node of the sentence.
static Path getPathToTop(GraphNode node, int verbosity)
          This static method creates a path leading from the input node to the root node of the sentence.
 GraphNode getPrev()
          Returns the previous GraphNode in this Path relative to the current position of this Path (iteration based method).
 int getVerbosity()
          Gets the currently set level of verbosity of this instance.
 boolean hasNext()
          Checks if there are more GraphNodes available on this path after the current cursor position of this instance.
 boolean hasPrev()
          Checks if there are more GraphNodes available on this path before the current cursor position of this instance.
 void invert()
          Inverts this path by reversing the order of the nodes and re-setting their directions (UP --> DOWN; DOWN --> UP).
static Path makePath(GraphNode start_node, GraphNode end_node)
          This static method returns the shortest path that connects the two nodes.
protected  boolean oneArgumentDomain()
          DOCUMENT ME!
 void removeFirst()
          DOCUMENT ME!
 void removeLast()
          DOCUMENT ME!
 void setVerbosity(int verbosity)
          Sets the currently set level of verbosity of this instance.
 java.lang.String toGildeaStyleString()
          Returns a string representation of this Path similar to that used by Daniel Gildea.
 java.lang.String toString()
          Returns a string representation of this Path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

steps

protected java.util.ArrayList steps
DOCUMENT ME!


start_below_end

protected boolean start_below_end
DOCUMENT ME!


end_below_start

protected boolean end_below_start
DOCUMENT ME!


verbosity

protected int verbosity
The higher this value the more process and debug information will written to stderr.

Method Detail

toString

public java.lang.String toString()
Returns a string representation of this Path.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this Path.

toGildeaStyleString

public java.lang.String toGildeaStyleString()
Returns a string representation of this Path similar to that used by Daniel Gildea.

Returns:
A string representation of this Path similar to that used by Daniel Gildea.

oneArgumentDomain

protected boolean oneArgumentDomain()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPathToTop

public static final Path getPathToTop(GraphNode node)
This static method creates a path leading from the input node to the root node of the sentence. Use this method or #makePath(GraphNodestart_node,GraphNodeend_node) to instantiate this class.

Parameters:
node - The GraphNode to start the path from.
Returns:
A Path instance representing a path from node to the root node.

getPathToTop

public static final Path getPathToTop(GraphNode node,
                                      int verbosity)
This static method creates a path leading from the input node to the root node of the sentence. Use this method or #makePath(GraphNodestart_node,GraphNodeend_node) to instantiate this class.

Parameters:
node - The GraphNode to start the path from.
verbosity - DOCUMENT ME!
Returns:
A Path instance representing a path from node to the root node.

makePath

public static final Path makePath(GraphNode start_node,
                                  GraphNode end_node)
This static method returns the shortest path that connects the two nodes.

Parameters:
start_node - The first GraphNode to connect.
end_node - The second GraphNode to connect.
Returns:
A Path instance representing the shortest path between start_node and end_node

invert

public void invert()
Inverts this path by reversing the order of the nodes and re-setting their directions (UP --> DOWN; DOWN --> UP).


getPrev

public GraphNode getPrev()
Returns the previous GraphNode in this Path relative to the current position of this Path (iteration based method).

Returns:
The previous GraphNode in this Path.

hasPrev

public boolean hasPrev()
Checks if there are more GraphNodes available on this path before the current cursor position of this instance.

Returns:
True iff there are more nodes on this path left to the cursor.

getNext

public GraphNode getNext()
Returns the next GraphNode in this Path relative to the current position of this Path (iteration based method).

Returns:
The next GraphNode in this Path.

hasNext

public boolean hasNext()
Checks if there are more GraphNodes available on this path after the current cursor position of this instance.

Returns:
True iff there are more nodes on this path right to the cursor.

getFirst

public GraphNode getFirst()
Returns the first GraphNode in this Path.

Returns:
The first GraphNode in this Path.

getLast

public GraphNode getLast()
Returns the last GraphNode in this Path.

Returns:
The last GraphNode in this Path.

removeFirst

public void removeFirst()
DOCUMENT ME!


removeLast

public void removeLast()
DOCUMENT ME!


getVerbosity

public int getVerbosity()
Gets the currently set level of verbosity of this instance. The higher the value the more information is written to stderr.

Returns:
The level of verbosity.

setVerbosity

public void setVerbosity(int verbosity)
Sets the currently set level of verbosity of this instance. The higher the value the more information is written to stderr.

Parameters:
verbosity - The level of verbosity.