If I have function names stored as strings in a Hashtable.
Is there a way to access the functions via the stored strings?
EDIT
I'm afraid the platform that i'm working on CLDC1.1/MIDP2.0 does not support Reflection.
Any workaround possible?
Just use a big long list of else-ifs:
[...]
} else if ("foo".equals(function)) {
target. foo();
} else if ("bar".equals(function)) {
target. bar();
[...]
(Although I generally don't like attempting vertical alignments in source, I think in cases like this it is well worth it.)
Storing a functor in the map is an alternative, bu might increase object size too much for many MIDP applications.