|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
org.progeeks.cmd.CommandMap
public class CommandMap
A Map implementation that matches objects to commands and provides a convenient way to execute those commands targeted to a certain object. This is useful for setting up custom event frameworks and such. Keys can be associated with single commands or collections of commands. Configuration options can be specified to allow the command map to accumulate commands when put() is called for the same key.
Constructor Summary | |
---|---|
CommandMap()
|
Method Summary | |
---|---|
boolean |
getConcatenate()
Returns true if the command map will accumulate commands for the same key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Adds the specified key and command to the map. |
Result |
runCommand(java.lang.Object key,
java.lang.Object target)
Runs the command associated with the specified key object using the specified target. |
Result |
runCommand(java.lang.Object key,
java.lang.Object target,
boolean mustRun)
Runs the command associated with the specified key object using the specified target. |
void |
setConcatenate(boolean flag)
Set to true if the command map should accumulate commands for the same key. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public CommandMap()
Method Detail |
---|
public void setConcatenate(boolean flag)
public boolean getConcatenate()
public Result runCommand(java.lang.Object key, java.lang.Object target, boolean mustRun)
public Result runCommand(java.lang.Object key, java.lang.Object target)
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in class java.util.HashMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |