All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface aioli.vtp.Tree

public interface Tree
extends Cloneable, AnnotatedTree, Serializable
Defines the notion of tree.


Method Index

 o adopt(Tree, int)
Adds a tree in a list tree.
 o append(Tree)
Appends two list trees.
 o appendMatch(Tree, TreeMatchStruct)
If the tree matches the pattern, it appends results with the new ones.
 o arity()
Gets the arity of the tree.
 o atomReplace(AtomValue. )
Changes the atomic value of the tree.
 o atomReplace(String)
Special case of the previous function where the string format.
 o atomValue()
Gets the atomic value of the tree
 o begin()
Returns A TreeIterator positioned on the first element.
 o beginBottomUp()
Returns A BottomUpTreeWalk.
 o beginTopDown()
Returns A TopDownTreeWalk or null for atomic tree.
 o changeSon(Tree, int)
Changes the value of a son.
 o checkPhylum(Phylum)
Checks if a tree belongs to a particular phylum.
 o clone()
 o copy()
Gives a copy of the tree.
 o copyAnnotations(Tree)
Copies the annotations of tree given in parameter.
 o delete()
After this action the tree is not subtree of any other trees.
 o disown(int)
Deletes the son of a tree.
 o down(int)
Moves down in the tree.
 o equals(Tree)
Checks the equality between two tree.
 o equiv(Tree)
Checks the equality between two tree.
 o father()
Returns the father of the tree.
 o formalism()
Returns the formalism of the tree.
 o genXML(PrintWriter)
Returns the -expression version of the tree
 o genXML(PrintWriter, String)
 o getPos(Tree)
Returns the move needed to reach this tree from its father.
 o left(int)
Moves left in the tree.
 o length()
Returns the number of sons of the tree.
 o makeSubListTree(int, int)
Returns a subTree of tree starting at rank with nbSons.
 o match(Tree)
A filter.
 o move()
Returns the move of the tree.
 o nextMatch(Tree, TreeMatchStruct)
Finds the next matching position.
 o operator()
Returns the operator of the tree.
 o operatorName()
Returns the name of the operator of the tree.
 o path()
Returns the path of the tree
 o phylum()
Returns the phylum that is constrained by the father.
 o rank()
Returns the rank of the tree.
 o read(byte[])
Reads a serialized tree from a file.
 o read(String)
Reads a serialized tree from a file.
 o replace(TreeMatchStruct)
Replaces in the tree pattern the occurence of metavariable, extract patterns, annotation patterns and assign patterns by their values stores in struct.
 o right(int)
Moves right in the tree .
 o serialize()
Serializes a Tree and puts it in a byte array
 o serialize(String)
Serializes a Tree, and writes it in a file called filename.
 o setFather(Tree)
Sets the father of the tree.
 o sons()
Returns the list of sons of the tree.
 o toString()
Returns the s-expression version of the tree
 o up(int)
Moves up in the tree.

Methods

 o adopt
 public abstract void adopt(Tree newtree,
                            int n)
Adds a tree in a list tree.

Parameters:
newtree - is the tree to be added.
n - is the rank at which the tree should be added.
 o arity
 public abstract Arity arity()
Gets the arity of the tree.

Returns:
The arity of the tree.
 o atomValue
 public abstract AtomValue.  atomValue()
Gets the atomic value of the tree

Returns:
The atomic value of the tree if the tree is atomic, null otherwise.
See Also:
AtomValue
 o atomReplace
 public abstract void atomReplace(AtomValue.  val)
Changes the atomic value of the tree.

Parameters:
val - the atomic value. This function has no effect if the tree is not atomic.
See Also:
AtomValue
 o atomReplace
 public abstract void atomReplace(String val)
Special case of the previous function where the string format. is used as an universal one.

Parameters:
val - the string representation of the value. This function has no effect if the tree is not atomic.
 o changeSon
 public abstract void changeSon(Tree newtree,
                                int n)
Changes the value of a son.

Parameters:
newtree - the new tree.
n - the rank of the tree to be changed.
 o checkPhylum
 public abstract boolean checkPhylum(Phylum ph)
Checks if a tree belongs to a particular phylum.

Parameters:
ph - is the phylum that may contain the operator of the tree.
Returns:
true if the tree belongs to the phylum ph false otherwise.
 o copy
 public abstract Tree copy()
Gives a copy of the tree.

Returns:
A Tree.
 o copyAnnotations
 public abstract Tree copyAnnotations(Tree tree)
Copies the annotations of tree given in parameter.

 o delete
 public abstract void delete()
After this action the tree is not subtree of any other trees.

 o disown
 public abstract void disown(int n)
Deletes the son of a tree.

Parameters:
n - is the integer we need in order to get the son to be removed.
 o equals
 public abstract boolean equals(Tree tree)
Checks the equality between two tree.

Parameters:
tree - The tree to be compared.
Returns:
true if the trees are equal false otherwise.
 o clone
 public abstract Object clone()
Overrides:
clone in class Object
 o equiv
 public abstract boolean equiv(Tree tree)
Checks the equality between two tree.

Parameters:
tree - The tree to be compared.
Returns:
true if the trees are equal false otherwise.
 o father
 public abstract Tree father()
Returns the father of the tree.

Returns:
The father of the tree if it exists otherwise null.
 o setFather
 public abstract void setFather(Tree tree)
Sets the father of the tree.

Parameters:
tree - The father of the tree.
 o up
 public abstract Tree up(int i)
Moves up in the tree.

Parameters:
i - The number of time needed to go up.
Returns:
The Tree that is the ith parent tree of the tree
 o right
 public abstract Tree right(int i)
Moves right in the tree .

Parameters:
i - The number of time needed to go right.
Returns:
The Tree that is the ith sibling to the right of the tree, otherwise null.
 o left
 public abstract Tree left(int i)
Moves left in the tree.

Parameters:
i - The number of time needed to go left.
Returns:
The Tree that is the ith sibling to the left of the tree, otherwise null.
 o down
 public abstract Tree down(int n)
Moves down in the tree.

Parameters:
n - The number of time needed to go down.
Returns:
The Tree that is the ith subtree of the tree (from left) starting at 0.
 o length
 public abstract int length()
Returns the number of sons of the tree.

Returns:
  • returns 0 if it's an atomic tree,
  • returns the arity if it's a fixed tree it,
  • returns the number of sons if it's a list tree it.
 o operatorName
 public abstract String operatorName()
Returns the name of the operator of the tree.

Returns:
The name of the operator.
 o operator
 public abstract Operator operator()
Returns the operator of the tree.

Returns:
The operator of the tree.
 o phylum
 public abstract Phylum phylum()
Returns the phylum that is constrained by the father.

Returns:
if there is no father it returns null.
 o getPos
 public abstract int getPos(Tree tree)
Returns the move needed to reach this tree from its father.

Returns:
if there is no father it returns null.
 o rank
 public abstract int rank()
Returns the rank of the tree.

Returns:
if there is no father it returns -1.
 o move
 public abstract Move move()
Returns the move of the tree.

Returns:
if there is no father it returns null.
 o sons
 public abstract Tree[] sons()
Returns the list of sons of the tree.

Returns:
An array containing the sons.
 o append
 public abstract Tree append(Tree tree)
Appends two list trees. The sons of the param tree are added at the end of the tree.

Returns:
The tree with the sons added if both trees are list trees otherwise the tree is left the same.
 o begin
 public abstract TreeIterator begin()
Returns A TreeIterator positioned on the first element.

 o beginTopDown
 public abstract TopDownTreeWalk beginTopDown()
Returns A TopDownTreeWalk or null for atomic tree.

 o beginBottomUp
 public abstract BottomUpTreeWalk beginBottomUp()
Returns A BottomUpTreeWalk.

 o formalism
 public abstract Formalism formalism()
Returns the formalism of the tree.

Returns:
the formalism of the tree.
 o path
 public abstract IPath path()
Returns the path of the tree

 o match
 public abstract TreeMatchStruct match(Tree pattern)
A filter.

Parameters:
pattern - A pattern tree.
Returns:
A TreeMatchStruct when the tree is an instance of pattern or null otherwise.
 o appendMatch
 public abstract boolean appendMatch(Tree pattern,
                                     TreeMatchStruct results)
If the tree matches the pattern, it appends results with the new ones. the pattern should not contains extrcat patterns.

Returns:
true if pattern matches the tree.
 o nextMatch
 public abstract TreeMatchStruct nextMatch(Tree patt,
                                           TreeMatchStruct struct)
Finds the next matching position.

Parameters:
patt - The pattern to match again.
struct - The structure of the previous match.
Returns:
A new stucture or null if there's no more match.
 o replace
 public abstract Tree replace(TreeMatchStruct struct)
Replaces in the tree pattern the occurence of metavariable, extract patterns, annotation patterns and assign patterns by their values stores in struct.

Parameters:
struct - The results of a pattern matching.
Returns:
a Tree of null if it fails.
 o makeSubListTree
 public abstract Tree makeSubListTree(int rank,
                                      int nbSons)
Returns a subTree of tree starting at rank with nbSons. The root operator must have a list arity (this is not checked).

Returns:
A tree or null if we can't obtain the requested subtree.
 o toString
 public abstract String toString()
Returns the s-expression version of the tree

Overrides:
toString in class Object
 o serialize
 public abstract void serialize(String filename)
Serializes a Tree, and writes it in a file called filename.

Parameters:
filename - The name of the file.
 o serialize
 public abstract byte[] serialize()
Serializes a Tree and puts it in a byte array

Returns:
A byte array containig the tree.
 o read
 public abstract Tree read(String filename)
Reads a serialized tree from a file.

Parameters:
filename - The name of the file where the serialized tree is stored.
Returns:
A tree.
 o read
 public abstract Tree read(byte tree[])
Reads a serialized tree from a file.

Parameters:
tree[] - The byte array where the serialized tree is stored.
Returns:
A tree.
 o genXML
 public abstract void genXML(PrintWriter ps)
Returns the -expression version of the tree

 o genXML
 public abstract void genXML(PrintWriter ps,
                             String str)

All Packages  Class Hierarchy  This Package  Previous  Next  Index