com.kenai.jaffl.provider

Class NativeInvocationHandler.InvokerMap

private static final class NativeInvocationHandler.InvokerMap extends Object

A custom map-like class for fast mapping between a Method and an Invoker.

This is not a standard Map - it does not support removing or replacing of elements, just gets and insertions.

It is optimized for many-reads, minimal writes.

Constructor Summary
InvokerMap(int maxEntries)
Creates a new Method->Invoker map
Method Summary
Invokerget(Method method)
Gets an Invoker from the map for method
voidput(Method method, Invoker invoker)
Creates a new mapping between a Method and an Invoker

Constructor Detail

InvokerMap

public InvokerMap(int maxEntries)
Creates a new Method->Invoker map

Parameters: maxEntries the maximum size of the map. No more entries than this can be added.

Method Detail

get

public final Invoker get(Method method)
Gets an Invoker from the map for method

Parameters: method the method to get an Invoker for

Returns: an Invoker if the method is in the table, else null

put

public final void put(Method method, Invoker invoker)
Creates a new mapping between a Method and an Invoker

Parameters: method the Method to create the mapping for invoker the Invoker to associate with the method.