cz.cuni.mff.mirovsky.trees
Class TNode

java.lang.Object
  extended by cz.cuni.mff.mirovsky.trees.TNode

public class TNode
extends java.lang.Object

A representation of a node in a tree. It points to its father, its first son and its immediate brother.


Field Summary
 TNode brother
           
 TNode first_son
           
 boolean matching_edge
           
 boolean matching_node
           
 TNode parent
           
 float poradi_N
           
 float poradi_W
           
 boolean skryvany
           
 TValue values
           
 
Constructor Summary
TNode()
           
 
Method Summary
 void addAttributes(int number)
          It increases number of attributes at the node by the given number.
 TNode getClone()
          Returns a deep copy of the node and its whole subtree.
 int getNumberOfSets()
          Returns the number of present sets.
 java.awt.Rectangle getRectangle()
          Returns the rectangle covering the area of the displayed node along with its labels.
 TValue getSetOfAttributes(int set_number)
          Returns the set of attributes with the given number (counted from 0).
 java.lang.String getValue(int set_number, int attr_number, int value_number)
          Returns the value of the attribute with the given number of set and the given number of attribute and number of value (counted from 0).
 TAHLine getValues(int set_number, int attr_number)
          Returns a linked list of values of the attribute with the given number of set and the given number of attribute (counted from 0).
 int getX()
          Returns the x-position of the displayed node
 int getY()
          Returns the y-position of the displayed node
 void setRectangle(java.awt.Rectangle rectangle_new)
          Sets the computed rectangle covering the area occupied by the displayed node and its labels.
 void setX(int x_new)
          Sets the x-position of the displayed node
 void setY(int y_new)
          Sets the y-position of the displayed node
 java.lang.String toFSString(NGTreeHead head, boolean recursively)
          Returns FS representation of the node (recursively or not)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

public TValue values

brother

public TNode brother

first_son

public TNode first_son

parent

public TNode parent

poradi_W

public float poradi_W

poradi_N

public float poradi_N

skryvany

public boolean skryvany

matching_node

public boolean matching_node

matching_edge

public boolean matching_edge
Constructor Detail

TNode

public TNode()
Method Detail

getClone

public TNode getClone()
Returns a deep copy of the node and its whole subtree. There must not be a cycle in the subtree (otherwise, the function never ends).

Returns:
a deep copy of the node and its whole subtree

toFSString

public java.lang.String toFSString(NGTreeHead head,
                                   boolean recursively)
Returns FS representation of the node (recursively or not)

Parameters:
head - a head to the tree
recursively - true iff subtree should be processed too
Returns:
FS representation of the node (recursively or not)

getX

public int getX()
Returns the x-position of the displayed node

Returns:
the x-position of the displayed node

getY

public int getY()
Returns the y-position of the displayed node

Returns:
the y-position of the displayed node

setX

public void setX(int x_new)
Sets the x-position of the displayed node

Parameters:
x_new - the new x-position of the node

setY

public void setY(int y_new)
Sets the y-position of the displayed node

Parameters:
y_new - the new y-position of the node

getRectangle

public java.awt.Rectangle getRectangle()
Returns the rectangle covering the area of the displayed node along with its labels.

Returns:
the rectangle covering the area of the displayed node along with its labels

setRectangle

public void setRectangle(java.awt.Rectangle rectangle_new)
Sets the computed rectangle covering the area occupied by the displayed node and its labels.

Parameters:
rectangle_new - the new rectangle

getValue

public java.lang.String getValue(int set_number,
                                 int attr_number,
                                 int value_number)
Returns the value of the attribute with the given number of set and the given number of attribute and number of value (counted from 0).

Returns:
the value of the attribute with the given number of set and the given number of attribute and number of value (counted from 0); null if not present or specified or out of bounds. Relations are not reflected here!

getValues

public TAHLine getValues(int set_number,
                         int attr_number)
Returns a linked list of values of the attribute with the given number of set and the given number of attribute (counted from 0).

Returns:
a linked list of values of the attribute with the given number of set and the given number of attribute (counted from 0); null if not present or specified or out of bounds

getSetOfAttributes

public TValue getSetOfAttributes(int set_number)
Returns the set of attributes with the given number (counted from 0).

Returns:
the set of attributes with the given number (counted from 0); null if not present or specified or out of bounds

getNumberOfSets

public int getNumberOfSets()
Returns the number of present sets.

Returns:
the number of present sets

addAttributes

public void addAttributes(int number)
It increases number of attributes at the node by the given number. The new attributes are added at the end of the list of attributes. The values of the attributes are set empty ("").

Parameters:
number - number of attributes to be added