1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
package ConsoleApplication1;
import java.util.List ;
import java.lang.Object;
import java.lang.String;
import java.util.ArrayList ;
/**
* Summary description for rally.
*/
public class Jrally
{
public Jrally()
{
}
// constructeur parametré
public Jrally( String dateDeb, String dateF, int lastEta, int lastNr , String nomR ,String paysR )
{
if ( existeDeja() )
{
dateDebut = dateDeb;
dateFin = dateF ;
lastEtape = 0 ;
lastNR = 0 ;
nom = nomR ;
pays = paysR;
List listeCamion;
List listeConcurrent;
List listeEtape;
List listeChrono;
}
}
// prog qui ajoute un concurrent
public void addConcurrent( String unNom )
{
lastNR++ ;
Jconcurrent unConcurrent = new Jconcurrent(unNom,lastNR) ;
listeConcurrent.add(unConcurrent);
}
// prog qui ajoute un véhicule
public void addVehicule(String type, String marque, String modele, int extra )
{
if ( type.compareTo("voiture") == 0 )
{
Jvoiture voiture = new Jvoiture(extra,marque,modele, lastNR);
listeVoiture.add(voiture);
}
else
{
Jcamion camion = new Jcamion(extra, marque,modele, lastNR);
listeCamion.add(camion);
}
}
// prog qui ajoute un chrono
public void addChrono(float unTemps, int unNumConcurrent, int unNumEtape)
{
Jchrono chrono = new Jchrono( unTemps, unNumConcurrent, unNumEtape );
listeChrono.add(chrono);
}
// prog qui ajoute une étape
public void addEtape( int unKm, String uneVilleArrivee, String uneVilleDepart )
{
lastEtape++;
Jetape etape = new Jetape(lastEtape,unKm,uneVilleArrivee,uneVilleDepart);
listeEtape.add(etape);
}
// programme vérifiant l'existance d'un rally
public boolean existeDeja()
{
if (nom.compareTo("") == 0)
{
return true;
}
else
{
return false;
}
}
// liste des accesseurs
// les GET
public String getDateDebut()
{
return dateDebut;
}
public String getDateFin()
{
return dateFin;
}
public int getLastEtape()
{
return lastEtape;
}
public int getLastNR()
{
return lastNR;
}
public String getNom()
{
return nom;
}
public String getPays()
{
return pays;
}
public List getListeCamion()
{
return listeCamion;
}
public List getListeConcurrent()
{
return listeConcurrent;
}
public List getListeEtape()
{
return listeEtape;
}
public List getListeChrono()
{
return listeChrono;
}
public List getListeVoiture()
{
return listeVoiture;
} |
Partager