| java.lang.Object com.jamonapi.utils.CommandIterator
CommandIterator | public class CommandIterator extends java.lang.Object (Code) | | Used with the Command interface to implement the Gang of 4 Command pattern to execute some logic for
every entry of various iterators. This class allows a Command object to be passed to various iterators.
This capability is also similar to function pointers in C.
|
Method Summary | |
public static void | iterate(ResultSet resultSet, Command command) Iterate through a ResultSet passing in a Command object. | public static void | iterate(Map map, Command command) Iterate through a Map passing Command object a Map.Entry. | public static void | iterate(Collection collection, Command command) Iterate through a Collection passing the Command object each element in the collection. | public static void | iterate() | public static void | iterate(Iterator iterator, Command command) | public static void | main(String argv) |
iterate | public static void iterate(ResultSet resultSet, Command command) throws Exception(Code) | | Iterate through a ResultSet passing in a Command object. The command object will be passed an Object[]
representing 1 row of the result set
|
iterate | public static void iterate(Map map, Command command) throws Exception(Code) | | Iterate through a Map passing Command object a Map.Entry.
Command code would look something like:
entry = (Map.Entry) object;
entry.getKey(), entry.getValue();
|
iterate | public static void iterate(Collection collection, Command command) throws Exception(Code) | | Iterate through a Collection passing the Command object each element in the collection. *
|
iterate | public static void iterate()(Code) | | Iterate through an Enumeration passing the Command object each element in the Collection *
|
iterate | public static void iterate(Iterator iterator, Command command) throws Exception(Code) | | Iterate passing each Command each Object that is being iterated *
|
|
|