modele
Class NoeudArbreExec

java.lang.Object
  extended by modele.NoeudArbreExec

public class NoeudArbreExec
extends java.lang.Object

This class is useful for an following execution tree in structural search of Palindrome's and definite each node.

Author:
@author Gabriel.chandesris (2008)

Field Summary
private  NoeudArbreExecListe fils
          Descendants in the tree of the current node.
private  PalindromeListe palindromes
          The node contain a list of Palindrome's.
private  NoeudArbreExec pere
          Father of current node.
 
Constructor Summary
NoeudArbreExec()
          Default constructor, a first node which has no father and contain an empty list of Palindrome's and has no descendants (empty list).
NoeudArbreExec(Palindrome[] palindromes)
          Constrcutor with a given table of Palindrome's.
NoeudArbreExec(Palindrome[] palindromes, NoeudArbreExec father)
          Constructor with a given table of Palindrome's and a father node.
NoeudArbreExec(PalindromeListe palindromes)
          Constrcutor with a given list of Palindrome's.
NoeudArbreExec(PalindromeListe palindromes, NoeudArbreExec father)
          Constructor with a given list of Palindrome's and a father node.
 
Method Summary
 void addExecutionNodes(PalindromeListeListe Em)
          This method to add new son's to current Node.
 void addFils(NoeudArbreExec newSon)
           
 void addFils(NoeudArbreExecListe newSons)
           
 boolean equals(NoeudArbreExec toCompare)
           
 PalindromeListe getAllPalindromes()
          A simple recursive ethod to get whole Palindrome's in the execution tree.
 PalindromeListeListe getAllStructures()
          A simple recursive mehtod to get all structures computed by algorithms.
 NoeudArbreExecListe getFils()
           
 NoeudArbreExec getFils(int i)
           
 int getGeneration()
          To get the generation level of current node in the execution tree.
 int getGenerationIter()
          To get the generation level of current node in the execution tree.
 Palindrome getPalindrome(int i)
           
 PalindromeListe getPalindromes()
           
 NoeudArbreExec getPere()
           
 boolean hasFils()
           
 boolean hasPalindrome(Palindrome elt)
           
 boolean isTreeNotFull(int canlimit)
          This method to know if palindrome's search can continue or not.
 void setFils(NoeudArbreExecListe fils)
           
 void setPalindromes(Palindrome[] palindromes)
           
 void setPalindromes(PalindromeListe palindromes)
           
 void setPere(NoeudArbreExec pere)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pere

private NoeudArbreExec pere
Father of current node.


fils

private NoeudArbreExecListe fils
Descendants in the tree of the current node.


palindromes

private PalindromeListe palindromes
The node contain a list of Palindrome's.

Constructor Detail

NoeudArbreExec

public NoeudArbreExec()
Default constructor, a first node which has no father and contain an empty list of Palindrome's and has no descendants (empty list).


NoeudArbreExec

public NoeudArbreExec(PalindromeListe palindromes)
Constrcutor with a given list of Palindrome's.

Parameters:
palindromes - (PalindromeListe)

NoeudArbreExec

public NoeudArbreExec(Palindrome[] palindromes)
Constrcutor with a given table of Palindrome's.

Parameters:
palindromes - (Palindrome[])

NoeudArbreExec

public NoeudArbreExec(PalindromeListe palindromes,
                      NoeudArbreExec father)
Constructor with a given list of Palindrome's and a father node.

Parameters:
palindromes - (PalindromeListe)
father - (NoeudArbreExec)

NoeudArbreExec

public NoeudArbreExec(Palindrome[] palindromes,
                      NoeudArbreExec father)
Constructor with a given table of Palindrome's and a father node.

Parameters:
palindromes - (Palindrome[])
father - (NoeudArbreExec)
Method Detail

getFils

public NoeudArbreExec getFils(int i)

getFils

public NoeudArbreExecListe getFils()

getPalindromes

public PalindromeListe getPalindromes()

getPalindrome

public Palindrome getPalindrome(int i)

getPere

public NoeudArbreExec getPere()

hasFils

public boolean hasFils()

hasPalindrome

public boolean hasPalindrome(Palindrome elt)

setFils

public void setFils(NoeudArbreExecListe fils)

setPere

public void setPere(NoeudArbreExec pere)

addFils

public void addFils(NoeudArbreExec newSon)

addFils

public void addFils(NoeudArbreExecListe newSons)

setPalindromes

public void setPalindromes(PalindromeListe palindromes)

setPalindromes

public void setPalindromes(Palindrome[] palindromes)

addExecutionNodes

public void addExecutionNodes(PalindromeListeListe Em)
This method to add new son's to current Node.

Parameters:
Em - PalindromeListe[] (tab of PalindromeListe)

getGeneration

public int getGeneration()
To get the generation level of current node in the execution tree. Top of the tree is generation 0 (father / grandfather of all nodes).
recursive way

Returns:
(int)generation
See Also:
getGenerationIter()

getGenerationIter

public int getGenerationIter()
To get the generation level of current node in the execution tree. Top of the tree is generation 0 (father / grandfather of all nodes).
iterative way

Returns:
(int)generation
See Also:
getGeneration()

isTreeNotFull

public boolean isTreeNotFull(int canlimit)
This method to know if palindrome's search can continue or not. The limit is fixed by Ms (30 : see thesis pages 95-96). If the number of alternate structures is under Ms : the tree is not full (return true).
Different steps of this method :
  1. Getting the father on top of the tree (and deducing number of structures of limit).
  2. Checking on each son (and deducing number of structures of limit).
  3. Checking on each grandson (and deducing number of structures of limit).
  4. Checking on each grandgrandson (and deducing number of structures of limit).
  5. Hope it would be enough...

Parameters:
canlimit - (int)Maximal number of palindromes / alternate structures accepted.
Returns:
(boolean)true if execution tree is not full.
See Also:
Algorithms.Ms

getAllPalindromes

public PalindromeListe getAllPalindromes()
A simple recursive ethod to get whole Palindrome's in the execution tree. Thus concerns palindromes in descendants nodes of current instance ! Use this method with the main (current) node of instance of Algorithms.

Returns:
(PalindromeListe)All Palindrome's contain by the tree.
See Also:
TODO SERVLET tester methode getAllPalindromes

getAllStructures

public PalindromeListeListe getAllStructures()
A simple recursive mehtod to get all structures computed by algorithms. Thus concerns palindromes in descendants nodes of current instance ! Use this method with the main (current) node of instance of Algorithms.

Returns:
(PalindromeListe[])All Structures of Palindromes. TODO SERVLET tester methode getAllStructures

equals

public boolean equals(NoeudArbreExec toCompare)