Index: lutinutil/src/java/org/codelutin/util/ListenerSet.java diff -u lutinutil/src/java/org/codelutin/util/ListenerSet.java:1.5 lutinutil/src/java/org/codelutin/util/ListenerSet.java:1.6 --- lutinutil/src/java/org/codelutin/util/ListenerSet.java:1.5 Fri Jun 3 13:54:23 2005 +++ lutinutil/src/java/org/codelutin/util/ListenerSet.java Fri Jun 10 12:43:54 2005 @@ -22,9 +22,9 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Mise a jour: $Date: 2005/06/03 13:54:23 $ + * Mise a jour: $Date: 2005/06/10 12:43:54 $ * par : $Author: bpoussin $ */ package org.codelutin.util; @@ -239,55 +239,6 @@ /** DOCUMENTME Method */ public void remove() { iter.remove(); - } - } - - /** - * Cette classe etant WeakReference et surcharge les méthodes equals et - * hashCode pour que ces méthodes retournes les mêmes résultat que les objets - * contenu. - */ - static class TransparenteWeakReference extends WeakReference { - /** - *DOCUMENTME Constructor for the TransparenteWeakReference object - * - * @param o DOCUMENTME Description of the Parameter - */ - public TransparenteWeakReference(Object o) { - super(o); - } - - /** - * DOCUMENTME Method - * - * @param o DOCUMENTME Description of the Parameter - * @return DOCUMENTME Description of the Return Value - */ - public boolean equals(Object o) { - // on travail avec un variable local pour ne pas etre obligé de - // synchroniser la méthode - Object local = get(); - if (o instanceof Reference) { - o = ((Reference)o).get(); - } - - return (o == null && local == null) - || (o != null && o.equals(local)); - } - - /** - * DOCUMENTME Method - * - * @return DOCUMENTME Description of the Return Value - */ - public int hashCode() { - // on travail avec une variable local pour ne pas etre obligé de - // synchroniser la méthode - Object local = get(); - if (local == null) { - return 0; - } - return local.hashCode(); } } Index: lutinutil/src/java/org/codelutin/util/TransparenteSoftReference.java diff -u /dev/null lutinutil/src/java/org/codelutin/util/TransparenteSoftReference.java:1.1 --- /dev/null Fri Jun 10 12:43:59 2005 +++ lutinutil/src/java/org/codelutin/util/TransparenteSoftReference.java Fri Jun 10 12:43:54 2005 @@ -0,0 +1,85 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ +/* * +* TransparenteSoftReference.java +* +* Created: 10 mai 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2005/06/10 12:43:54 $ +* par : $Author: bpoussin $ +*/ +package org.codelutin.util; +import java.beans.Statement; +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; + +import java.util.HashSet; +import java.util.Iterator; + +/** +* Cette classe etant SoftReference et surcharge les méthodes equals et +* hashCode pour que ces méthodes retournes les mêmes résultat que les objets +* contenu. +*/ +public class TransparenteSoftReference extends SoftReference { + /** + *DOCUMENTME Constructor for the TransparenteSoftReference object + * + * @param o DOCUMENTME Description of the Parameter + */ + public TransparenteSoftReference(Object o) { + super(o); + } + + /** + * DOCUMENTME Method + * + * @param o DOCUMENTME Description of the Parameter + * @return DOCUMENTME Description of the Return Value + */ + public boolean equals(Object o) { + // on travail avec un variable local pour ne pas etre obligé de + // synchroniser la méthode + Object local = get(); + if (o instanceof Reference) { + o = ((Reference)o).get(); + } + + return (o == null && local == null) + || (o != null && o.equals(local)); + } + + /** + * DOCUMENTME Method + * + * @return DOCUMENTME Description of the Return Value + */ + public int hashCode() { + // on travail avec une variable local pour ne pas etre obligé de + // synchroniser la méthode + Object local = get(); + if (local == null) { + return 0; + } + return local.hashCode(); + } +} Index: lutinutil/src/java/org/codelutin/util/TransparenteWeakReference.java diff -u /dev/null lutinutil/src/java/org/codelutin/util/TransparenteWeakReference.java:1.1 --- /dev/null Fri Jun 10 12:43:59 2005 +++ lutinutil/src/java/org/codelutin/util/TransparenteWeakReference.java Fri Jun 10 12:43:54 2005 @@ -0,0 +1,85 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ +/* * +* TransparenteWeakReference.java +* +* Created: 10 mai 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.1 $ +* +* Mise a jour: $Date: 2005/06/10 12:43:54 $ +* par : $Author: bpoussin $ +*/ +package org.codelutin.util; +import java.beans.Statement; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; + +import java.util.HashSet; +import java.util.Iterator; + +/** +* Cette classe etant WeakReference et surcharge les méthodes equals et +* hashCode pour que ces méthodes retournes les mêmes résultat que les objets +* contenu. +*/ +public class TransparenteWeakReference extends WeakReference { + /** + *DOCUMENTME Constructor for the TransparenteWeakReference object + * + * @param o DOCUMENTME Description of the Parameter + */ + public TransparenteWeakReference(Object o) { + super(o); + } + + /** + * DOCUMENTME Method + * + * @param o DOCUMENTME Description of the Parameter + * @return DOCUMENTME Description of the Return Value + */ + public boolean equals(Object o) { + // on travail avec un variable local pour ne pas etre obligé de + // synchroniser la méthode + Object local = get(); + if (o instanceof Reference) { + o = ((Reference)o).get(); + } + + return (o == null && local == null) + || (o != null && o.equals(local)); + } + + /** + * DOCUMENTME Method + * + * @return DOCUMENTME Description of the Return Value + */ + public int hashCode() { + // on travail avec une variable local pour ne pas etre obligé de + // synchroniser la méthode + Object local = get(); + if (local == null) { + return 0; + } + return local.hashCode(); + } +}