org.carrot2.util.CollectionUtils Maven / Gradle / Ivy
package org.carrot2.util;
import java.util.Collection;
/**
* Various utility methods for working with {@link Collection}s.
*/
public class CollectionUtils
{
/**
* Converts a {@link Collection} to a {@link String} separating entries by
* ,
.
*/
public static String toString(Collection> collection)
{
final StringBuffer string = new StringBuffer();
for (final Object object : collection)
{
string.append(object.toString());
string.append(", ");
}
string.delete(string.length() - 2, string.length());
return string.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy