|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jamonapi.utils.CommandIterator
public class 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 enumer,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void iterate(java.util.Map map, Command command) throws java.lang.Exception
Command code would look something like:
entry = (Map.Entry) object;
entry.getKey(), entry.getValue();
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 enumer, 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |