Your preferences have been saved!
» Dump collection to String - //package cc.mallet.util; import java.util.Collection; import java.util.Iterator; /**  *   *   * @author <a href="mailto:casutton@cs.umass.edu">Charles Sutton</a>  * @version $Id: ArrayUtils.java,v 1.1 2007/10/22 21:37:40 mccallum Exp $  */ public class Util {... 18 Feb 12 » Clones the lhs map and add all things from the - import java.util.HashMap; import java.util.Map; public class Main {   /**    * Clones the lhs map and add all things from the    * rhs map.    *    * @param lhs the first map    * @param rhs the second map    * @return the merged map... 18 Feb 12 » Clones a map and prefixes the keys in the clone - import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class Main {   /**    * Clones a map and prefixes the keys in the clone, e.g.    * for mapping "JAVA_HOME" to "env.JAVA_HOME" to simulate    * the behaviour of ANT.    *    * @param source the source map... 18 Feb 12 » Clone an array -  */ public class Main {   // Clone   //-----------------------------------------------------------------------   /**    * <p>Shallow clones an array returning a typecast result and handling    * <code>null</code>.</p>    *    * <p>The objects in the array are not cloned, thus there is no special    * handling for multi-dimensional arrays.</p>... 18 Feb 12 » A combination of two collections into a collection - */ import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.AbstractCollection; /**  * A combination of two collections into a collection.  *  * @author tomyeh  * @since 3.0.0... 18 Feb 12 » The collection related utilities - import java.util.AbstractCollection; import java.util.Collection; import java.util.Collections; import java.util.Set; import java.util.Map; import java.util.AbstractList; import java.util.List; import java.util.LinkedList; import java.util.Iterator; import java.util.ListIterator;... 18 Feb 12 » Get the difference of two collections - import java.util.ArrayList; import java.util.Collection; public class Utils {   public static <T> Collection<T> diff(Collection<T> c1, Collection<T> c2) {     if (c1 == null || c1.size() == 0 || c2 == null || c2.size() == 0) {         return c1;     }     Collection<T> difference = new ArrayList<T>();     for (T item : c1) {         if (!c2.contains(item)) {... 18 Feb 12 » Deep clone collection: Returns a new collection containing clones of - */ import java.awt.Shape; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Iterator; /**... 18 Feb 12 » Is collection is empty, and all of its elements are - import java.util.Collection; import java.util.Iterator; public class Utils {   public static <T> boolean isEmpty(Collection<T> c) {     if (c == null || c.size() == 0) {         return true;     }     for (Iterator<T> iter = c.iterator(); iter.hasNext();) {         if (iter.next() != null) {             return false;... 18 Feb 12 » Append, filter and get the size of collections - */ import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import org.w3c.dom.NodeList; /**... 18 Feb 12