|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jamonapi.utils.CommandIterator
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 | |
static void |
iterate(java.util.Collection collection,
Command command)
Iterate through a Collection passing the Command object each element in the collection. |
static void |
iterate(java.util.Enumeration enum,
Command command)
Iterate through an Enumeration passing the Command object each element in the Collection |
static void |
iterate(java.util.Iterator iterator,
Command command)
Iterate passing each Command each Object that is being iterated |
static void |
iterate(java.util.Map map,
Command command)
Iterate through a Map passing Command object a Map.Entry. |
static void |
iterate(java.sql.ResultSet resultSet,
Command command)
Iterate through a ResultSet passing in a Command object. |
static void |
main(java.lang.String[] argv)
Test code for this class |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void iterate(java.sql.ResultSet resultSet, Command command) throws java.lang.Exception
java.lang.Exception
public static void iterate(java.util.Map map, Command command) throws java.lang.Exception
java.lang.Exception
public static void iterate(java.util.Collection collection, Command command) throws java.lang.Exception
java.lang.Exception
public static void iterate(java.util.Enumeration enum, Command command) throws java.lang.Exception
java.lang.Exception
public static void iterate(java.util.Iterator iterator, Command command) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |