modele
Class PalindromeListe

java.lang.Object
  extended by modele.ObjectListe
      extended by modele.PalindromeListe

public class PalindromeListe
extends ObjectListe

This class to provide easy-to-use Palindrome tables / Lists.

Author:
Gabriel Chandesris (2008)

Field Summary
private  Palindrome[] liste
          The list of Palindrome's
private  double Stest
          Average of weight of Palindrome
 
Constructor Summary
PalindromeListe()
          Default constructor with a list of 0 elements.
PalindromeListe(Palindrome[] liste)
          Constructor with a pre-made table of Palindrome's.
 
Method Summary
 void addPalindrome(Palindrome elt)
          To add a Palindrome at the end of the list.
private  void computeAverageTest()
          This procedure to compute the score average of the table each time it changes.
 boolean equals(PalindromeListe toCompare)
          To know if two PalindromeListe are equals (local instance and an other).
 Palindrome[] getListe()
           
 PalindromeListe getListeCount(int countmin)
          To get a PalindromeListe, sublist of current instance of PalindromeListe, whith a minimum count.
 int getMaxCount()
          To get the maximum number of count for a Palindrome in current instance of PalindromeListe.
 Palindrome getPalindrome(int i)
           
 double getStest()
           
 boolean has(Palindrome elt)
          To know if a Palindrome is in this list.
 int length()
          To get the length of the current list of Object's
 int rechercher_approx(Palindrome toSearch)
          Deprecated. Tranformed to whichPositionApprox(Palindrome)
 int rechercher(Palindrome toSearch)
          Deprecated. Transformed to whichPosition(Palindrome)
 void removePalindrome(int nbElt)
          To remove a Palindrome at a specific place in the list.
 void removePalindrome(Palindrome elt)
          To remove a specific Palindrome.
 void setListe(Palindrome[] liste)
           
 void setPalindrome(Palindrome elt, int i)
           
 void sortByBeginPositionGrowing()
          To sort the table of Palindrome's by growing begin position.
 void sortByDecreasingRelevance()
          To sort the table of Palindrome's by decreasing relevance.
 void sortByEndPositionGrowing()
          To sort the table of Palindrome's by growing end position.
 int whichPosition(Palindrome elt)
          If a palindrome is present, give his position.
 int whichPositionApprox(Palindrome elt)
          If a palindrome is appromately present, give his position.
 
Methods inherited from class modele.ObjectListe
addObjet, equals, getListeObjects, getObject, has, removeObject, removeObject, setListe, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

liste

private Palindrome[] liste
The list of Palindrome's


Stest

private double Stest
Average of weight of Palindrome

Constructor Detail

PalindromeListe

public PalindromeListe()
Default constructor with a list of 0 elements.


PalindromeListe

public PalindromeListe(Palindrome[] liste)
Constructor with a pre-made table of Palindrome's.

Parameters:
liste -
Method Detail

length

public int length()
Description copied from class: ObjectListe
To get the length of the current list of Object's

Specified by:
length in class ObjectListe
Returns:
int

getStest

public double getStest()

getListe

public Palindrome[] getListe()

getPalindrome

public Palindrome getPalindrome(int i)

setListe

public void setListe(Palindrome[] liste)

setPalindrome

public void setPalindrome(Palindrome elt,
                          int i)

getMaxCount

public int getMaxCount()
To get the maximum number of count for a Palindrome in current instance of PalindromeListe.

Returns:
(int) the maximum count.
Since:
July 2008
See Also:
Palindrome.countPlusPlus(), Palindrome.getCount(), Palindrome.setCountZero(), Palindrome.count, Algorithms.commonPrediction(Sequence, SequenceListe[])

getListeCount

public PalindromeListe getListeCount(int countmin)
To get a PalindromeListe, sublist of current instance of PalindromeListe, whith a minimum count.

Parameters:
countmin - (int) minimal count
Returns:
(PalindromeListe)
Since:
July 2008

addPalindrome

public void addPalindrome(Palindrome elt)
To add a Palindrome at the end of the list.

Parameters:
elt - Palindrome to add.

has

public boolean has(Palindrome elt)
To know if a Palindrome is in this list.

Parameters:
elt - Palindrome.
Returns:
boolean

whichPosition

public int whichPosition(Palindrome elt)
If a palindrome is present, give his position.
Replace rechercher(Palindrome)

Parameters:
elt - (Palindrome)
Returns:
(int) position or (-1) if not present

whichPositionApprox

public int whichPositionApprox(Palindrome elt)
If a palindrome is appromately present, give his position.
Replace rechercher_approx(Palindrome)

Parameters:
elt - (Palindrome)
Returns:
(int) position or (-1) if not present

removePalindrome

public void removePalindrome(Palindrome elt)
To remove a specific Palindrome.

Parameters:
elt - Palindrome to remove

removePalindrome

public void removePalindrome(int nbElt)
To remove a Palindrome at a specific place in the list.

Parameters:
nbElt - Position of the Palindrome.

computeAverageTest

private void computeAverageTest()
This procedure to compute the score average of the table each time it changes.

See Also:
addPalindrome(Palindrome), removePalindrome(int), removePalindrome(Palindrome), PalindromeListe(Palindrome[])

sortByDecreasingRelevance

public void sortByDecreasingRelevance()
To sort the table of Palindrome's by decreasing relevance.
NOTE : relevance is computed when use isSelected method.

See Also:
Palindrome.isSelectedCible(double, double, boolean), Palindrome.getPertinence()

sortByEndPositionGrowing

public void sortByEndPositionGrowing()
To sort the table of Palindrome's by growing end position.

See Also:
Palindrome.getPositionFin()

sortByBeginPositionGrowing

public void sortByBeginPositionGrowing()
To sort the table of Palindrome's by growing begin position.
Second part of this method for use in (Stefan Engelen)'s implementation res-use in AlgorithmsStefan and OtherAlgorithmsStefan

See Also:
Palindrome.getPositionDebut()

equals

public boolean equals(PalindromeListe toCompare)
To know if two PalindromeListe are equals (local instance and an other).

Parameters:
toCompare - Other PalindromeListe.
Returns:
boolean

rechercher

public int rechercher(Palindrome toSearch)
Deprecated. Transformed to whichPosition(Palindrome)

"Following methods sorted by use order in ADN1 Class". (14)
"to find a palindrome in a Vector of palindromes"

Parameters:
toSearch - (Palindrome)
Returns:
(int) position
See Also:
OtherAlgorithmsStefan.resultat_commun(PalindromeListeListe)

rechercher_approx

public int rechercher_approx(Palindrome toSearch)
Deprecated. Tranformed to whichPositionApprox(Palindrome)

"Following methods sorted by use order in ADN1 Class". (15)
"to find an approximate palindrome in a vector of palindromes."

Parameters:
toSearch - (Vector)
Returns:
(int) position
See Also:
OtherAlgorithmsStefan.resultat_commun(PalindromeListeListe)