protected class GenericNativeWindow.EventInvocationCache extends HashMap<String,GenericNativeWindow.EventInvocationItem>
HashMap
derived class provides a fast mapping mechanism
between the name of an event method invoked on the native event interface
and the corresponding method to be invoked on a registered
NativeWindowListener
together with its event id.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected Class<?> |
eventListenerClazz
The class or interface on which the methods to be invoked are
declared.
|
protected Class<?>[] |
eventMethodSignature
The signature of the event methods to be invoked as needed by
java.lang.Class.getMethod(String, Class ...) |
Constructor and Description |
---|
EventInvocationCache()
Creates a new
EventInvocationCache populated with all
events declared in NativeWindowListener . |
Modifier and Type | Method and Description |
---|---|
GenericNativeWindow.EventInvocationItem |
put(Method method,
int eventId)
Associates the name of the method specified with the specified method
and event id as a
EventInvocationItem object in this
cache instance. |
GenericNativeWindow.EventInvocationItem |
put(String methodName,
int eventId)
Associates the method name specified with this method declared on
NativeWindowListener and the specified event id as a
EventInvocationItem object in this cache instance. |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
protected final Class<?> eventListenerClazz
java.lang.Class.getMethod(String, Class ...)
in method
EventInvocationItem.add(String, int)
.protected final Class<?>[] eventMethodSignature
java.lang.Class.getMethod(String, Class ...)
. All
methods declared in NativeWindowListener
take a single
parameter NativeWindowEvent
.public EventInvocationCache()
EventInvocationCache
populated with all
events declared in NativeWindowListener
.public GenericNativeWindow.EventInvocationItem put(Method method, int eventId)
EventInvocationItem
object in this
cache instance. If the cache previously contained a method with the
same name, the old cache entry is replaced. The method specified must
be declared on NativeWindowListener
or any descendant of
it.method
- the method to be used with this cache entryeventId
- the event id to be used with this cache entryEventInvocationItem
value associated with the name of the method , or
null
if there was no entry for the specified
methodIllegalArgumentException
- if the method specified was not declared on
NativeWindowListener
or any descendant of itput(String, int)
,
NativeWindowListener
public GenericNativeWindow.EventInvocationItem put(String methodName, int eventId)
NativeWindowListener
and the specified event id as a
EventInvocationItem
object in this cache instance. If
the cache previously contained a method with the same name, the old
cache entry is replaced.methodName
- the method name to be used with this cache entryeventId
- the event id to be used with this cache entryEventInvocationItem
value associated with the name of the method , or
null
if there was no entry for the specified
methodput(Method, int)
,
NativeWindowListener
Copyright © 2009 - 2016 DataGis. All Rights Reserved.