diff --git a/src/java/com/samskivert/util/Collections.java b/src/java/com/samskivert/util/Collections.java index 67894d85..eb93172d 100644 --- a/src/java/com/samskivert/util/Collections.java +++ b/src/java/com/samskivert/util/Collections.java @@ -16,14 +16,14 @@ public class Collections { /** * Returns an Iterator that iterates over all the elements contained within - * the Iterators within the specified Collection. + * the Iterators within the specified Iterable. * - * @param metaCollection a collection of Iterators. + * @param metaIterable an iterable of Iterators. */ public static Iterator getMetaIterator ( - Collection> metaCollection) + Iterable> metaIterable) { - return new MetaIterator(metaCollection); + return new MetaIterator(metaIterable); } /** @@ -31,7 +31,7 @@ public class Collections * elements in their natural order. */ public static > - Iterator getSortedIterator (Collection coll) + Iterator getSortedIterator (Iterable coll) { return getSortedIterator(coll.iterator(), new Comparator() { public int compare (T o1, T o2) { @@ -52,7 +52,7 @@ public class Collections * elements in the order dictated by the supplied Comparator. */ public static Iterator getSortedIterator ( - Collection coll, Comparator comparator) + Iterable coll, Comparator comparator) { return getSortedIterator(coll.iterator(), comparator); } @@ -93,13 +93,13 @@ public class Collections } /** - * Get an Iterator over the supplied Collection that returns + * Get an Iterator over the supplied Iterable that returns * the elements in a completely random order. Normally Iterators * return elements in an undefined order, but it is usually the same - * between different invocations as long as the underlying Collection + * between different invocations as long as the underlying Iterable * has not changed. This method mixes things up. */ - public static Iterator getRandomIterator (Collection c) + public static Iterator getRandomIterator (Iterable c) { return getRandomIterator(c.iterator()); } @@ -118,9 +118,9 @@ public class Collections /** * Get an Iterator that returns the elements in the supplied - * Collection but blocks removal. + * Iterable but blocks removal. */ - public static Iterator getUnmodifiableIterator (Collection c) + public static Iterator getUnmodifiableIterator (Iterable c) { return getUnmodifiableIterator(c.iterator()); } @@ -479,12 +479,12 @@ public class Collections protected static class MetaIterator implements Iterator { /** - * @param collections a Collection containing more Collections + * @param iterable a Iterable containing more Iterables * whose elements we are to iterate over. */ - public MetaIterator (Collection> collections) + public MetaIterator (Iterable> iterable) { - _meta = collections.iterator(); + _meta = iterable.iterator(); } // documentation inherited from interface Iterator diff --git a/src/java/com/samskivert/util/StringUtil.java b/src/java/com/samskivert/util/StringUtil.java index 7134b0b8..814cf4f9 100644 --- a/src/java/com/samskivert/util/StringUtil.java +++ b/src/java/com/samskivert/util/StringUtil.java @@ -659,8 +659,8 @@ public class StringUtil StringBuilder buf, Object val, Formatter formatter) { // get an iterator if this is a collection - if (val instanceof Collection) { - val = ((Collection)val).iterator(); + if (val instanceof Iterable) { + val = ((Iterable)val).iterator(); } String openBox = formatter.getOpenBox();