|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpmlib.PMLEventHandler
public class PMLEventHandler
PMLEventHandler Class
The PMLEventHandler object permits the routing of PMLEvent and PMLFloat objects to user specified methods using reflection.
This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.
Constructor Summary | |
---|---|
PMLEventHandler()
Create a new object instance |
Method Summary | |
---|---|
boolean |
add(java.lang.String tag,
java.lang.Object mobj,
java.lang.String mstr,
char[] args)
Add an object method to the event handler |
void |
clear()
Clear all object methods |
void |
debug()
Print the contents of this object to the output |
int |
remove(java.lang.Object mobj,
java.lang.String mstr,
char[] args)
Remove all object methods matching that specified |
int |
remove(java.lang.String tag)
Remove all object methods with the specified tag |
void |
route(PMLEvent evnt)
Route the event variables of the specified object to any attached methods with matching tag |
void |
route(PMLEvent[] evnt)
Route the event variables of the specified objects to any methods with matching tags |
void |
route(PMLFloat flt)
Route the value of the specified object to any attached methods with matching tags |
void |
route(PMLFloat[] flt)
Route the values of the specified objects to any attached methods with matching tags |
int |
size()
Return the number of attached methods |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PMLEventHandler()
Method Detail |
---|
public boolean add(java.lang.String tag, java.lang.Object mobj, java.lang.String mstr, char[] args)
Object methods should be public with no return value. Currently only
methods with int
, float
and String
arguments are supported. This limitation is based on the assertion that
other data types are unnecessary within the context of the PMLib library.
Method arguments should be specified by an array of characters with
'i'
, 'f'
and 's'
denoting
int
, float
and String
respectively.
For example, a method with the arguments (int, String, float, float)
should be specified with { 'i', 's', 'f', 'f' }
.
tag
- tagmobj
- method objectmstr
- method stringargs
- method arguments
public int remove(java.lang.String tag)
tag
- tag
public int remove(java.lang.Object mobj, java.lang.String mstr, char[] args)
mobj
- method objectmstr
- method stringargs
- method arguments
public void clear()
public void debug()
public void route(PMLFloat flt)
flt
- tagged floatpublic void route(PMLFloat[] flt)
flt
- tagged float arraypublic void route(PMLEvent evnt)
evnt
- tagged eventpublic void route(PMLEvent[] evnt)
evnt
- eventpublic int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |