MAJ
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// Fichier Exemple pour le second exercice sur l'ADN
|
||||
|
||||
public class Exemple {
|
||||
public static void main(String[] args) {
|
||||
// codon GCT code l'analine https://en.wikipedia.org/wiki/DNA_codon_table
|
||||
// stop codon TAG, voir https://en.wikipedia.org/wiki/Stop_codon
|
||||
|
||||
System.out.println("construction du brin GCTTAG");
|
||||
MonMaillon l = new MonMaillon(Base.G);
|
||||
l = new MonMaillon(Base.A, l);
|
||||
l = new MonMaillon(Base.T, l);
|
||||
l = new MonMaillon(Base.T, l);
|
||||
l = new MonMaillon(Base.C, l);
|
||||
l = new MonMaillon(Base.G, l);
|
||||
|
||||
MonBrin b = new MonBrin(l);
|
||||
|
||||
System.out.println("l'affichage par défaut du brin ne va pas vous plaire");
|
||||
System.out.println(b.toString());
|
||||
|
||||
System.out.println("On peut maintenant afficher en itérant avec un while comme ceci");
|
||||
|
||||
while (b.hasNext()) {
|
||||
System.out.println(b.next());
|
||||
}
|
||||
|
||||
// Simulation de plusieurs navigations successives
|
||||
System.out.println("Navigation successive avec l'index secondaire :");
|
||||
while (b.hasNextSecondaire()) {
|
||||
System.out.println(b.nextSecondaire());
|
||||
}
|
||||
|
||||
System.out.println("Navigation successive avec l'index tertiaire :");
|
||||
while (b.hasNextTertiaire()) {
|
||||
System.out.println(b.nextTertiaire());
|
||||
}
|
||||
|
||||
// Simulation de plusieurs navigations simultanées
|
||||
System.out.println("Navigation simultanée :");
|
||||
if (b.hasNextSecondaire())
|
||||
System.out.println("Secondaire: " + b.nextSecondaire());
|
||||
if (b.hasNextTertiaire())
|
||||
System.out.println("Tertiaire: " + b.nextTertiaire());
|
||||
if (b.hasNextSecondaire())
|
||||
System.out.println("Secondaire: " + b.nextSecondaire());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user