Skip to content

Commit

Permalink
- added : more comment on different classes
Browse files Browse the repository at this point in the history
  • Loading branch information
first-developer committed Jan 18, 2012
1 parent 9436aa8 commit a0b8471
Show file tree
Hide file tree
Showing 35 changed files with 145 additions and 331 deletions.
Binary file removed bin/parser/MyParser.class
Binary file not shown.
Binary file removed bin/parser/myXMLHandler.class
Binary file not shown.
Binary file removed bin/tools/Msg.class
Binary file not shown.
Binary file modified classifieur/BadDomainException.class
Binary file not shown.
9 changes: 9 additions & 0 deletions classifieur/BadDomainException.java
@@ -1,7 +1,16 @@
// ===================================
// PROJET QUESACO
// @autors : Laura BENDHAIBA
// Lionel LONKAP TSAMBA
// ===================================

package classifieur;


import tools.Msg;

// Class: BadDomainException
//========================================================
public final class BadDomainException extends Exception {

private static final long serialVersionUID = 1L;
Expand Down
Binary file modified classifieur/Caracteristique.class
Binary file not shown.
45 changes: 30 additions & 15 deletions classifieur/Caracteristique.java
Expand Up @@ -6,14 +6,18 @@

package classifieur;

// Class: Caracteristique
// ========================================================
public class Caracteristique {
/**
* attribut
*/

// Attributes
// ========================================================
private String intitule;
private Domaine dm;


// Constructor
// ========================================================
public Caracteristique() {
this.intitule = "";
this.dm= null;
Expand All @@ -24,30 +28,41 @@ public Caracteristique(String s, Domaine d) {
this.dm=d;
}

public void setIntitule(String s) {
this.intitule=s;
}


public String toString(){
String result="- "+this.getIntitule()+" : ";
result=result+ dm.toString();
return result;
}
// Methods
// ========================================================

// getter and setter

// getDomaine
public Domaine getDomaine (){
return this.dm;
}

// setDomaine
public void setDomaine (Domaine d){
this.dm = d;
}

// getIntitule
public String getIntitule() {
return intitule;
}
// setIntitule
public void setIntitule(String s) {
this.intitule=s;
}

// checkObservation
public boolean checkObservation(Observation o) {
return o.hasCharact(this);
}

public String getIntitule() {
return intitule;

// toString
public String toString(){
String result="- "+this.getIntitule()+" : ";
result=result+ dm.toString();
return result;
}

}
Binary file modified classifieur/Categorie.class
Binary file not shown.
7 changes: 0 additions & 7 deletions classifieur/Categorie.java
Expand Up @@ -145,7 +145,6 @@ public boolean seClasseSous(Observation o) {
}
return b;
}


// addCaracteristique
public void addCaracteristique(Caracteristique caract) {
Expand All @@ -167,10 +166,4 @@ public String toString() {

return res;
}






}
Binary file modified classifieur/Classifieur.class
Binary file not shown.
13 changes: 3 additions & 10 deletions classifieur/Classifieur.java
Expand Up @@ -70,8 +70,7 @@ public ArrayList<Categorie> classer(Observation o){

// ajoute_si_se_classe_sous
private void ajoute_si_se_classe_sous(Categorie cat, ArrayList<Categorie> liste_categories, Observation o) {
if(cat.seClasseSous(o))
{
if(cat.seClasseSous(o)) {
liste_categories.add(cat);
}
}
Expand All @@ -91,24 +90,18 @@ public static void testEngloge(Categorie mere, Categorie fille) {
}
}


// Save
public void save (String fileName) throws FileNotFoundException, IOException
{
public void save (String fileName) throws FileNotFoundException, IOException {
ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream (fileName) );
out.writeObject(this.getMere());
out.close();
}

// Load
public void load(String fileName) throws FileNotFoundException, IOException, ClassNotFoundException
{
public void load(String fileName) throws FileNotFoundException, IOException, ClassNotFoundException {
Msg.puts("Chargement de la typologie ... ");

ObjectInputStream in = new ObjectInputStream( new FileInputStream(fileName));
this.setMere((Categorie)in.readObject());


}

}
Binary file modified classifieur/Domaine.class
Binary file not shown.
9 changes: 4 additions & 5 deletions classifieur/Domaine.java
Expand Up @@ -7,13 +7,12 @@
package classifieur;

public abstract class Domaine {
/**
* m�thodes
*/

// Methods
// ========================================================
public Domaine() {

}

abstract public boolean Inclus (Domaine d) throws BadDomainException;
abstract public boolean inclus (Domaine d) throws BadDomainException;

}
Binary file modified classifieur/Element.class
Binary file not shown.
20 changes: 14 additions & 6 deletions classifieur/Element.java
Expand Up @@ -7,29 +7,37 @@
package classifieur;

public class Element {
/**
* attribut
*/

// Attributes
// ========================================================
private String nom;

/**
* methodes
*/
// Constructor
// ========================================================
public Element() {
this.setNom("");
}

public Element(String s) {
this.setNom(s);
}

// Methods
// ========================================================

// getter and setter

// getNom
public String getNom() {
return nom;
}

// setNom
public void setNom(String nom) {
this.nom = nom;
}

// toString
public String toString() {
return this.nom;
}
Expand Down
Binary file modified classifieur/EnsembleDeChaines.class
Binary file not shown.
14 changes: 13 additions & 1 deletion classifieur/EnsembleDeChaines.java
Expand Up @@ -8,18 +8,28 @@

import java.util.ArrayList;

//Class: EnsembleDeChaines
//========================================================
public class EnsembleDeChaines extends Domaine {

// Attributes
// ========================================================
ArrayList<Element> el;

// Constructor
// ========================================================
public EnsembleDeChaines() {
el = new ArrayList<Element>();
}

// Methods
// ========================================================
// addElement
public void addElement(Element e){
el.add(e);
}

// contains
public boolean contains(String s){
boolean b = true;
for (Element e : el)
Expand All @@ -29,7 +39,8 @@ public boolean contains(String s){
return b;
}

public boolean Inclus (Domaine d) throws BadDomainException {
// inclus
public boolean inclus (Domaine d) throws BadDomainException {
// test si je suis inclus dans d
boolean b;
if(d instanceof EnsembleDeChaines)
Expand All @@ -47,6 +58,7 @@ public boolean Inclus (Domaine d) throws BadDomainException {
}
}

// toString
public String toString(){
String result;
result = "Ensemble : {";
Expand Down
Binary file modified classifieur/IntervalleNumerique.class
Binary file not shown.
37 changes: 29 additions & 8 deletions classifieur/IntervalleNumerique.java
@@ -1,12 +1,22 @@
package classifieur;
// ===================================
// PROJET QUESACO
// @autors : Laura BENDHAIBA
// Lionel LONKAP TSAMBA
// ===================================

package classifieur;

//Class: IntervalleNumerique
//========================================================
public class IntervalleNumerique extends Domaine {


// Attributes
// ========================================================
private double inf;
private double sup;


// Constructor
// ========================================================
public IntervalleNumerique() {
this.inf=0.0;
this.sup=0.0;
Expand All @@ -17,27 +27,37 @@ public IntervalleNumerique(double a, double b) {
this.sup=b;
}

// Methods
// ========================================================

// getter and setter
// setInf
public void setInf(Double i) {
this.inf = i;
}

public void setSup(Double i) {
this.sup = i;
}

// getInf
public Double getInf() {
return this.inf;
}

// setSup
public void setSup(Double i) {
this.sup = i;
}

// getSup
public Double getSup() {
return this.sup;
}

// contains
public boolean contains(double d){
return (d>=this.inf) && (d<=this.sup);
}

public boolean Inclus (Domaine d) throws BadDomainException {
// inclus
public boolean inclus (Domaine d) throws BadDomainException {
// test si je suis inclus dans "d"
if(d instanceof IntervalleNumerique)
{
Expand All @@ -49,6 +69,7 @@ public boolean Inclus (Domaine d) throws BadDomainException {
}
}

// toString
public String toString(){
String result;
result="Intervalle : ["+this.inf+", "+this.sup+"]\n";
Expand Down
Binary file modified classifieur/Observation.class
Binary file not shown.
20 changes: 17 additions & 3 deletions classifieur/Observation.java
@@ -1,19 +1,31 @@
package classifieur;

// ===================================
// PROJET QUESACO
// @autors : Laura BENDHAIBA
// Lionel LONKAP TSAMBA
// ===================================

package classifieur;

// Import
// ========================================================
import java.util.ArrayList;

public class Observation {

// Attributes
// ========================================================
ArrayList<ObservationItem> items;


// Constructor
// ========================================================
public Observation(ObservationItem o) {
this.items = new ArrayList<ObservationItem>();
this.items.add(o);
}

// Methods
// ========================================================
// hasCharact
public boolean hasCharact(Caracteristique c){
boolean b = true;
for (ObservationItem oi : items)
Expand All @@ -23,6 +35,7 @@ public boolean hasCharact(Caracteristique c){
return b;
}

// verifObservation
public boolean verifObservation(Caracteristique ca) {
// on verifie d'abord si les intitules de caracteristiques correspondent
// bi : booleen intitule
Expand All @@ -34,6 +47,7 @@ public boolean verifObservation(Caracteristique ca) {
return bi;
}

// veriObservationValue
public boolean verifObservationValue(Caracteristique ca){
// on verifie maintenant si les valeurs correspondent
// bi : booleen intitule
Expand Down
Binary file modified classifieur/ObservationItem.class
Binary file not shown.

0 comments on commit a0b8471

Please sign in to comment.