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.
-
adopt(Tree, int)
-
Adds a tree in a list tree.
-
append(Tree)
- Appends two list trees.
-
appendMatch(Tree, TreeMatchStruct)
- If the tree matches the pattern, it appends results with the new ones.
-
arity()
-
Gets the arity of the tree.
-
atomReplace(AtomValue. )
-
Changes the atomic value of the tree.
-
atomReplace(String)
-
Special case of the previous function where the string format.
-
atomValue()
-
Gets the atomic value of the tree
-
begin()
- Returns A TreeIterator positioned on the first element.
-
beginBottomUp()
- Returns A BottomUpTreeWalk.
-
beginTopDown()
- Returns A TopDownTreeWalk or null
for atomic tree.
-
changeSon(Tree, int)
-
Changes the value of a son.
-
checkPhylum(Phylum)
- Checks if a tree belongs to a particular phylum.
-
clone()
-
-
copy()
- Gives a copy of the tree.
-
copyAnnotations(Tree)
- Copies the annotations of tree given in parameter.
-
delete()
- After this action the tree is not subtree of any other trees.
-
disown(int)
-
Deletes the son of a tree.
-
down(int)
-
Moves down in the tree.
-
equals(Tree)
-
Checks the equality between two tree.
-
equiv(Tree)
-
Checks the equality between two tree.
-
father()
-
Returns the father of the tree.
-
formalism()
- Returns the formalism of the tree.
-
genXML(PrintWriter)
- Returns the -expression version of the tree
-
genXML(PrintWriter, String)
-
-
getPos(Tree)
-
Returns the move needed to reach this tree from its father.
-
left(int)
- Moves left in the tree.
-
length()
- Returns the number of sons of the tree.
-
makeSubListTree(int, int)
- Returns a subTree of tree starting at rank with nbSons.
-
match(Tree)
- A filter.
-
move()
- Returns the move of the tree.
-
nextMatch(Tree, TreeMatchStruct)
- Finds the next matching position.
-
operator()
- Returns the operator of the tree.
-
operatorName()
- Returns the name of the operator of the tree.
-
path()
- Returns the path of the tree
-
phylum()
- Returns the phylum that is constrained by the father.
-
rank()
- Returns the rank of the tree.
-
read(byte[])
- Reads a serialized tree from a file.
-
read(String)
- Reads a serialized tree from a file.
-
replace(TreeMatchStruct)
- Replaces in the tree pattern the occurence of metavariable,
extract patterns, annotation patterns and assign patterns by their
values stores in struct.
-
right(int)
- Moves right in the tree .
-
serialize()
- Serializes a Tree and puts it in a byte array
-
serialize(String)
- Serializes a Tree, and writes it in a file called filename.
-
setFather(Tree)
- Sets the father of the tree.
-
sons()
-
Returns the list of sons of the tree.
-
toString()
-
Returns the s-expression version of the tree
-
up(int)
- Moves up in the tree.
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.
arity
public abstract Arity arity()
- Gets the arity of the tree.
- Returns:
- The arity of the tree.
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
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
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.
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.
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.
copy
public abstract Tree copy()
- Gives a copy of the tree.
- Returns:
- A Tree.
copyAnnotations
public abstract Tree copyAnnotations(Tree tree)
- Copies the annotations of tree given in parameter.
delete
public abstract void delete()
- After this action the tree is not subtree of any other trees.
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.
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.
clone
public abstract Object clone()
- Overrides:
- clone in class Object
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.
father
public abstract Tree father()
- Returns the father of the tree.
- Returns:
- The father of the tree if it exists otherwise null.
setFather
public abstract void setFather(Tree tree)
- Sets the father of the tree.
- Parameters:
- tree - The father of the tree.
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
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.
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.
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.
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.
operatorName
public abstract String operatorName()
- Returns the name of the operator of the tree.
- Returns:
- The name of the operator.
operator
public abstract Operator operator()
- Returns the operator of the tree.
- Returns:
- The operator of the tree.
phylum
public abstract Phylum phylum()
- Returns the phylum that is constrained by the father.
- Returns:
- if there is no father it returns null.
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.
rank
public abstract int rank()
- Returns the rank of the tree.
- Returns:
- if there is no father it returns -1.
move
public abstract Move move()
- Returns the move of the tree.
- Returns:
- if there is no father it returns null.
sons
public abstract Tree[] sons()
- Returns the list of sons of the tree.
- Returns:
- An array containing the sons.
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.
begin
public abstract TreeIterator begin()
- Returns A TreeIterator positioned on the first element.
beginTopDown
public abstract TopDownTreeWalk beginTopDown()
- Returns A TopDownTreeWalk or null
for atomic tree.
beginBottomUp
public abstract BottomUpTreeWalk beginBottomUp()
- Returns A BottomUpTreeWalk.
formalism
public abstract Formalism formalism()
- Returns the formalism of the tree.
- Returns:
- the formalism of the tree.
path
public abstract IPath path()
- Returns the path of the tree
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.
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.
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.
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.
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.
toString
public abstract String toString()
- Returns the s-expression version of the tree
- Overrides:
- toString in class Object
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.
serialize
public abstract byte[] serialize()
- Serializes a Tree and puts it in a byte array
- Returns:
- A byte array containig the tree.
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.
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.
genXML
public abstract void genXML(PrintWriter ps)
- Returns the -expression version of the tree
genXML
public abstract void genXML(PrintWriter ps,
String str)
All Packages Class Hierarchy This Package Previous Next Index