Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

MoreCollections.java

Go to the documentation of this file.
00001 
00057 package com.arcle.rmt.j2se.util;
00058 
00059 import java.util.Collection;
00060 import java.util.Iterator;
00061 
00070 public final class MoreCollections {
00071 
00072     private MoreCollections() {
00073         throw new Error("MoreCollections is just a container for static methods.");
00074     }
00075 
00088     public static boolean visitCollection(Collection c, CollectionVisitor v) {
00089         boolean wantsMore = true;
00090         Iterator iter = c.iterator();
00091         while (iter.hasNext() && wantsMore) {
00092             wantsMore = v.visitCollection(iter.next());
00093         }
00094         // when wantsMore is true, iteration is stopped because the iterator
00095         // does not have more elements.
00096         return wantsMore;
00097     }
00098 }

Generated on Fri Jun 18 19:51:22 2004 for Arcle Rambutan by doxygen 1.3.5