modele
Class SequenceListe

java.lang.Object
  extended by modele.ObjectListe
      extended by modele.SequenceListe
Direct Known Subclasses:
AlignedSequences, AlignedSequences, ListeBean

public class SequenceListe
extends ObjectListe

This class to provide easy-to-use Sequence tables / Lists.
Tests showing that for factorielle, limit considering Java int limit is 15 !!

Author:
Gabriel Chandesris (2008)

Field Summary
private  Sequence[] liste
          The list of Sequence's.
private  double moyenneVariabilite
          Average of variabilite of Sequence's in list.
 
Constructor Summary
SequenceListe()
          Default constructor with a list of 0 elements.
SequenceListe(Sequence[] liste)
          Constructor with a pre-made table of Sequence.
 
Method Summary
 void addSequence(Sequence elt)
          To add a Sequence at the end of the list.
 java.lang.Object clone()
          To get a copy of the current SequenceListe.
static SequenceListe[] combinationWithoutRepetition(int k, int n, SequenceListe C)
          Maybe not the best way to make combination / arrangement without repetition, but works well.
static int combinatoire(int n, int k)
          The classic k!
 void computeAverageVariabilite()
          This procedure to compute the variabilite average of the table.
 boolean equals(SequenceListe toCompare)
          To know if two SequenceListe are equals (local instance and an other).
static int factorielle(int n)
          This method compute a factorial of a number by the iterative way.
 Sequence[] getListe()
           
 double getMoyenneVariabilite()
           
 Sequence getSequence(int i)
           
 Sequence getSequence(java.lang.String nom)
           
 boolean has(Sequence elt)
          To know if a Sequence is in this list.
 boolean isIn(SequenceListe[] listes)
          To know if current instance of SequenceListe is in a table of SequenceListe's.
 int length()
          To get the length of the current list of Object's
 void removeSequence(int nbElt)
          To remove a Sequence at a specific place in the list.
 void removeSequence(Sequence elt)
          To remove a specific Sequence.
 void setListe(Sequence[] liste)
           
 void setSequence(Sequence elt, int i)
           
 void sortByDecreasing(int var)
          Sort by decreasing (default = homology with cible sequence) : (0) variability
 void sortByIncreasing(int var)
          Sort by increasing (default = homology with cible sequence) : (0) variability
 
Methods inherited from class modele.ObjectListe
addObjet, equals, getListeObjects, getObject, has, removeObject, removeObject, setListe, setObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

liste

private Sequence[] liste
The list of Sequence's.


moyenneVariabilite

private double moyenneVariabilite
Average of variabilite of Sequence's in list.

See Also:
Sequence.variabilite
Constructor Detail

SequenceListe

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


SequenceListe

public SequenceListe(Sequence[] liste)
Constructor with a pre-made table of Sequence.

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

getMoyenneVariabilite

public double getMoyenneVariabilite()

getListe

public Sequence[] getListe()

getSequence

public Sequence getSequence(java.lang.String nom)

getSequence

public Sequence getSequence(int i)

setListe

public void setListe(Sequence[] liste)

setSequence

public void setSequence(Sequence elt,
                        int i)

addSequence

public void addSequence(Sequence elt)
To add a Sequence at the end of the list.

Parameters:
elt - Sequence to add.

has

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

Parameters:
elt - Sequence.
Returns:
boolean

removeSequence

public void removeSequence(Sequence elt)
To remove a specific Sequence.

Parameters:
elt - Sequence to remove

removeSequence

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

Parameters:
nbElt - Position of the Sequence.

computeAverageVariabilite

public void computeAverageVariabilite()
This procedure to compute the variabilite average of the table.

See Also:
Algorithms.defaultPredictionOfStructure(modele.Sequence, modele.SequenceListe, int)

sortByDecreasing

public void sortByDecreasing(int var)
Sort by decreasing (default = homology with cible sequence) :

sortByIncreasing

public void sortByIncreasing(int var)
Sort by increasing (default = homology with cible sequence) :

equals

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

Parameters:
toCompare - Other SequenceListe.
Returns:
boolean

clone

public java.lang.Object clone()
To get a copy of the current SequenceListe.

Overrides:
clone in class java.lang.Object
Returns:
(SequenceListe)Object

isIn

public boolean isIn(SequenceListe[] listes)
To know if current instance of SequenceListe is in a table of SequenceListe's.

Parameters:
listes - (SequenceListe[]) (table of SequenceListe's).
Returns:
(boolean) true if is in liste, else false;

factorielle

public static int factorielle(int n)
This method compute a factorial of a number by the iterative way.
Considered int limit of length !! (don't give more than 16)
Should be considered as a Private method. (except for tests).

Parameters:
n - (int)
Returns:
(int)[n!]
See Also:
combinationWithoutRepetition(int, int, SequenceListe), Algorithms.defaultPredictionOfStructure(modele.Sequence, modele.SequenceListe, int)

combinatoire

public static int combinatoire(int n,
                               int k)
The classic k!/((k!)*(n-k)!). Binomial coefficient.

Parameters:
n - (int)
k - (int)
Returns:
(int)

combinationWithoutRepetition

public static SequenceListe[] combinationWithoutRepetition(int k,
                                                           int n,
                                                           SequenceListe C)
Maybe not the best way to make combination / arrangement without repetition, but works well.

Parameters:
k - Number of elements in series (k-uplets) you want.
n - Global number of elements of C (C.length()).
C - The SequenceListe you want to get series.
Returns:
SequenceListe[]
See Also:
Algorithms.defaultPredictionOfStructure(modele.Sequence, modele.SequenceListe, int), factorielle(int)