|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcz.cuni.mff.mirovsky.trees.NGForest
public class NGForest
A class keeping a forest of trees. It is usually only one tree, in case of multi-tree query it consists of several trees.
| Field Summary | |
|---|---|
static byte |
EOL
a line break in messages with the server. |
static byte |
EOL_2
an alternative line break in messages with the server. |
static byte |
EOM
an end-of-message character in messages with the server. |
| Constructor Summary | |
|---|---|
NGForest(ShowMessagesAble mess)
Creates a new empty forest. |
|
| Method Summary | |
|---|---|
void |
addAttributes(int number)
It increases number of attributes at all nodes of all trees by number. |
void |
addTree(NGTree tree)
Adds a tree as the new last tree in the forest. |
TNode |
findNodeById(int id_index,
java.lang.String value)
Searches for a node in the forest that has a given id. |
NGForest |
getClone()
Returns a deep copy of the forest. |
java.lang.String |
getFileName()
Return the file name the forest comes from. |
int |
getFirstMatchingNodeDepthOrder(boolean count_hidden)
Returns depth-first order (counted from 1) of the node matching the root of the first tree of the query. |
boolean |
getFlagForestChanged()
Says whether the forest has changed and coordinates of (some of) its trees and their nodes must be calculated. |
int |
getForestNumber()
Returns the number of the forest in the file it comes from. |
NGTreeHead |
getHead()
Returns the head of the forest. |
TNode |
getChosenNode()
Returns the actually selected node. |
int |
getChosenNodeDepthOrder(boolean count_hidden)
Returns depth-first order of the chosen node, counted from 1. |
NGTree |
getChosenTree()
Returns the actually selected tree. |
int |
getChosenTreeOrder()
Returns the order of the selected tree (the tree with the selected node), counted from 1. |
java.lang.String |
getId()
Returns an id of the first tree in the forest. |
int |
getNumberOfHiddenNodes()
Returns the total number of hidden nodes in all trees in the forest. |
int |
getNumberOfNodes()
Returns the total number of all nodes in all trees in the forest. |
int |
getNumberOfTrees()
Returns the number of trees in the forest. |
java.util.ArrayList<NGTree> |
getTrees()
Returns the trees of the forest in ArrayList. |
javax.swing.DefaultListModel |
getVybraneAtributy()
Returns a list of selected attributes. |
int |
readForest(char[] p_source,
int start_position,
int p_number_of_attributes)
Reads a forest from p_source in FS format (without a head). |
void |
setFileName(java.lang.String p_name)
Sets the name of the file the forest comes from. |
void |
setFlagForestChanged(boolean flag)
Signals whether a tree in the forest has changed and coordinates the tree and its nodes and coordinates of the subsequent trees must be calculated. |
void |
setFlagWholeForestChanged(boolean flag)
Signals whether the whole forest has changed and coordinates of all its trees and their nodes must be calculated. |
void |
setForestNumber(int number)
Sets the number of the forest in the file it comes from. |
void |
setHead(NGTreeHead head)
Sets a head of the forest. |
void |
setChosenNodeByDepthOrder(int order)
Marks a node with given order as selected, as well as the tree the node is from. |
void |
setChosenTreeByOrder(int order)
Sets the tree with a given order as selected. |
void |
setMatchingMetaTags()
It sets the matching meta tag at the matching nodes of the trees of the forest. |
void |
setVybraneAtributy(javax.swing.DefaultListModel p_vybrane_atributy)
Sets a list of selected attributes. |
java.lang.String |
toFSString(boolean with_head)
Returns FS representation of the forest (with or without the head). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte EOL
public static final byte EOL_2
public static final byte EOM
| Constructor Detail |
|---|
public NGForest(ShowMessagesAble mess)
mess - an object capable of displaying messages| Method Detail |
|---|
public NGForest getClone()
public java.lang.String toFSString(boolean with_head)
with_head - says if the head should be included in the FS representation
public java.lang.String getId()
public int getNumberOfTrees()
public void addTree(NGTree tree)
tree - a tree to be addedpublic void setFlagWholeForestChanged(boolean flag)
flag - value true signals that the coordinates need to be calculatedpublic void setFlagForestChanged(boolean flag)
flag - value true signals that the coordinates need to be calculatedpublic boolean getFlagForestChanged()
public NGTreeHead getHead()
public void setHead(NGTreeHead head)
head - a headpublic java.util.ArrayList<NGTree> getTrees()
public javax.swing.DefaultListModel getVybraneAtributy()
public void setVybraneAtributy(javax.swing.DefaultListModel p_vybrane_atributy)
p_vybrane_atributy - the list of selected attributespublic int getNumberOfNodes()
public int getNumberOfHiddenNodes()
public void addAttributes(int number)
number - number of attributes to be addedpublic void setMatchingMetaTags()
public TNode getChosenNode()
public NGTree getChosenTree()
public java.lang.String getFileName()
public void setFileName(java.lang.String p_name)
p_name - the name of the file the forest comes frompublic int getForestNumber()
public void setForestNumber(int number)
number - the number of the forest in the file it comes frompublic void setChosenNodeByDepthOrder(int order)
order - depth-first order of the node to be selectedpublic int getChosenNodeDepthOrder(boolean count_hidden)
count_hidden - says if hidden nodes should be counted
public int getFirstMatchingNodeDepthOrder(boolean count_hidden)
count_hidden - says if hidden nodes should be counted
public int getChosenTreeOrder()
public void setChosenTreeByOrder(int order)
order - the order of the tree to be selected
public TNode findNodeById(int id_index,
java.lang.String value)
id_index - an index of the id-attribute in the head of the forestvalue - an identifier to be searched for
public int readForest(char[] p_source,
int start_position,
int p_number_of_attributes)
p_source - the source in FS formatstart_position - a position in p_source of the first character to be readp_number_of_attributes - number of attributes in the head
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||