All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dragome.commons.compiler.classpath.J7Helper Maven / Gradle / Ivy

The newest version!
package com.dragome.commons.compiler.classpath;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public class J7Helper
{
	public static String join(String s, Object... a)
	{
		StringBuilder o= new StringBuilder();
		for (Iterator i= Arrays.asList(a).iterator(); i.hasNext();)
			o.append(i.next()).append(i.hasNext() ? s : "");
		return o.toString();
	}

	static  void sort(List list, Comparator comparator)
	{
		Object[] a= list.toArray();
		Arrays.sort(a, (Comparator) comparator);
		ListIterator i= list.listIterator();
		for (Object e : a)
		{
			i.next();
			i.set((T) e);
		}
	}
}