Index: lutinutil/src/java/org/codelutin/util/CollectionUtil.java diff -u /dev/null lutinutil/src/java/org/codelutin/util/CollectionUtil.java:1.1 --- /dev/null Mon Aug 7 19:31:49 2006 +++ lutinutil/src/java/org/codelutin/util/CollectionUtil.java Mon Aug 7 19:31:44 2006 @@ -0,0 +1,70 @@ +/* *##% + * Copyright (C) 2006 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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. + *##%*/ + +/* * + * CollectionUtil.java + * + * Created: 23 févr. 2006 09:03:39 + * + * @author poussin + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2006/08/07 19:31:44 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.util; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + + +/** + * @author poussin + * + */ + +public class CollectionUtil { + + /** + * Ajoute a la collection tous les elements passés en parametre + * @param col la collection + * @param e les elements a ajouter + * @return la collection passé en parametre + */ + static public > E addAll(E col, A ... e) { + Collections.addAll(col, e); + return col; + } + + /** + * Ajoute a la liste tous les elements passés en parametre + * @param col la liste + * @param e les elements a ajouter + * @return la liste passé en parametre + */ + static public > E addAll(E col, int pos, A ... e) { + col.addAll(pos, Arrays.asList(e)); + return col; + } +} + +