K - The type of keys contained by the MethodMappublic class BoundMethodMap<K> extends AbstractMethodMap<K>
| Constructor and Description |
|---|
BoundMethodMap(MapEntryKeyFactory<K> entryKeyFactory,
AbstractBoundMethodCollectionFactory methodCollectionFactory,
java.lang.invoke.MethodHandles.Lookup lookup) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
invoke(K key,
ArgsFactory argsFactory)
Invokes the methodhandle contained in the methodhandleinfo mapped to the provided key with
arguments produced by the given argsfactory.
|
java.lang.Object |
invoke(K key,
java.lang.Object... args)
Invokes the methodhandle contained in the methodhandleinfo mapped to the provided key with
the given arguments.
|
java.lang.Object |
invoke(java.lang.Object... args)
Treats the first argument as the key, the remaining arguments as the methodhandle
arguments, and invokes the methodhandle contained in the methodhandleinfo
mapped to the provided key with the given arguments.
|
getMethodHandleInfo, invoke, invokeclear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic BoundMethodMap(MapEntryKeyFactory<K> entryKeyFactory, AbstractBoundMethodCollectionFactory methodCollectionFactory, java.lang.invoke.MethodHandles.Lookup lookup) throws DuplicateKeyException, java.lang.IllegalAccessException, MethodCollectionProductionException, MapEntryKeyProductionException
entryKeyFactory - the factory used to generate keys for each of
the methods produced by
methodCollectionFactorymethodCollectionFactory - Produces the collection of methods that will be
included in this methodmap. The target object is
also contained in this factory.lookup - the lookup object used to convert the produced
methods into methodhandlesDuplicateKeyException - If more than one of the same key is generated
for the entries of the methodmap.java.lang.IllegalAccessException - If methodhandle lookup fails for any of the
produced methods.MethodCollectionProductionException - If the methodcollectionfactory fails to produce
a method collection.MapEntryKeyProductionException - If entry keys fail to be generated for any of
the produced methods.public java.lang.Object invoke(K key, java.lang.Object... args) throws UnmappedKeyException, InvocationException
AbstractMethodMapinvoke in class AbstractMethodMap<K>key - the key to which the desired methodhandleinfo is mappedargs - the arguments to be passed to the methodhandleUnmappedKeyException - If there is no methodhandleinfo associated with the provided
key.InvocationException - If invocation fails.public java.lang.Object invoke(K key, ArgsFactory argsFactory) throws UnmappedKeyException, ArgsProductionException, InvocationException
AbstractMethodMapinvoke in class AbstractMethodMap<K>key - the key to which the desired methodhandleinfo is mappedargsFactory - Produces the arguments that are passed to the methodhandle.UnmappedKeyException - If there is no methodhandleinfo associated with the provided
key.ArgsProductionException - If the argsfactory fails to produce arguments.InvocationException - If invocation fails.public java.lang.Object invoke(java.lang.Object... args)
throws UnmappedKeyException,
InvocationException
AbstractMethodMapinvoke in class AbstractMethodMap<K>args - the key to which the desired methodhandleinfo is mapped and the
arguments to be passed to the methodhandleUnmappedKeyException - If there is no methodhandleinfo associated with the provided
key.InvocationException - If invocation fails.