/** Iterate through a Collection passing the Command object each element in the collection. **/ public static void iterate(Collection collection, Command command)throws Exception { iterate(collection.iterator() , command); }
/** Iterate through a Map passing Command object a Map.Entry. * * <p>Command code would look something like:</p> * <pre>{@code * entry = (Map.Entry) object; * entry.getKey(), entry.getValue(); * }</pre> **/ public static void iterate(Map map, Command command)throws Exception { iterate(map.entrySet().iterator() , command); }
/** Iterate through an Enumeration passing the Command object each element in the Collection **/ public static void iterate(Enumeration enumer, Command command)throws Exception { iterate(new EnumIterator(enumer) , command); }
iterate(vector.elements(), testCommand);