|
From: <de...@us...> - 2003-08-18 11:21:31
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type
In directory sc8-pr-cvs1:/tmp/cvs-serv3430/h2d/type
Modified Files:
H2dBordType.java H2dEnumType.java
Log Message:
Maj des projets hydraulique 2d
Index: H2dBordType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dBordType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dBordType.java 4 Jul 2003 13:13:45 -0000 1.1
--- H2dBordType.java 18 Aug 2003 11:05:19 -0000 1.2
***************
*** 46,53 ****
}
- public boolean equalsBord(H2dBordType _t)
- {
- return id_==_t.id_;
- }
-
}
--- 46,48 ----
Index: H2dEnumType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dEnumType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dEnumType.java 4 Jul 2003 13:13:45 -0000 1.1
--- H2dEnumType.java 18 Aug 2003 11:05:19 -0000 1.2
***************
*** 9,18 ****
package org.fudaa.dodico.h2d.type;
/**
* @author deniger
* @version $Id$
*/
! public class H2dEnumType implements Comparable
! {
int id_;
String nom_;
--- 9,20 ----
package org.fudaa.dodico.h2d.type;
+ import java.util.Iterator;
+ import java.util.List;
+
/**
* @author deniger
* @version $Id$
*/
! public class H2dEnumType implements Comparable {
int id_;
String nom_;
***************
*** 21,65 ****
*
*/
! H2dEnumType(int _id,String _nom)
! {
! id_=_id;
! nom_=_nom;
}
!
! public String getNom()
! {
return nom_;
}
!
! public String toString()
! {
! return nom_+" ("+id_+")";
}
! public boolean equals(Object _o)
! {
if (_o == this)
return true;
! if (!(_o instanceof H2dEnumType))
! {
return false;
}
! return id_ == ((H2dEnumType) _o).id_;
}
-
/**
! *
*/
! public int compareTo(Object o)
! {
if (o == this)
return 0;
! if (o instanceof H2dEnumType)
! {
! return nom_.compareTo(((H2dEnumType) o).nom_);
! }
! else
throw new IllegalArgumentException("compareTo " + getClass().getName());
}
--- 23,71 ----
*
*/
! H2dEnumType(int _id, String _nom) {
! id_= _id;
! nom_= _nom;
}
!
! public String getNom() {
return nom_;
}
!
! public String toString() {
! return nom_ + " (" + id_ + ")";
}
! public int getId() {
! return id_;
! }
!
! public boolean equals(Object _o) {
if (_o == this)
return true;
! if (!(getClass().isInstance(_o))) {
return false;
}
! return id_ == ((H2dEnumType)_o).id_;
}
/**
! * Compare selon le nom de le nom de l'enumeration
*/
! public int compareTo(Object o) {
if (o == this)
return 0;
! if (o instanceof H2dEnumType) {
! return nom_.compareTo(((H2dEnumType)o).nom_);
! } else
throw new IllegalArgumentException("compareTo " + getClass().getName());
+ }
+
+ public static H2dEnumType getIdInList(List _l, int _id) {
+ for (Iterator it= _l.iterator(); it.hasNext();) {
+ H2dEnumType e= (H2dEnumType)it.next();
+ if (e.id_ == _id)
+ return e;
+ }
+ return null;
}
|