> From: Berin Loritsch [mailto:[EMAIL PROTECTED] > We could write the requirement that this happens, i.e.: > > The Type returned MUST be unique to a given class so that > > a.getType() == b.getType(); > > if > > a.getClass().equals(b.getClass()); > > However, if the Classes for "a" and "b" are different classes > (even if one is a subclass of the other), then a.getType != b.getType();
That would be perfect. All I want is to put it in writing that an EventHandler must be able to process events correctly just by looking at the class of the event. (We could, of course, require all events to be final classes.) When I wrote the ReflectionEventHandler I thought about someone writing something like this: public class ConnectionEvent implements Signal { private final long type; public ConnectionEvent (long type) { this.type = type; } . . . public long getType () { return type; } } In order to avoid having to declare many classes. Since the ReflectionEventHandler uses the type of the argument to lookup the handler function, and not the typeid, this would make it dispatch incorrectly. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>