org.psjava.util.IteratorToString Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of psjava Show documentation
Show all versions of psjava Show documentation
Problem Solving Library for Java
The newest version!
package org.psjava.util;
import java.util.Iterator;
public class IteratorToString {
public static String toString(Iterator iter) {
StringBuilder sb = new StringBuilder();
sb.append('(');
while (iter.hasNext()) {
T v = iter.next();
sb.append(v);
if (iter.hasNext())
sb.append(',');
}
sb.append(')');
return sb.toString();
}
private IteratorToString() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy