public class MethodTernaryTree
extends java.lang.Object
In JMX methods are referred to with the method name and the String[] representing the signature.
One can decide to cache method information using as key a concatenation of method name + signature,
but the cost of concatenation is very high, while hashmap access is fast.
Ternary trees avoid string concatenation, and result to be 10x faster than concatenation + hashmap.
However, the signature of a standard TernaryTree would be Object get(Object[] key)
and
void put(Object[] key, Object value)
. Unfortunately normalizing method name + signature
into a single array is also very expensive.
This version leaves method name and signature separated to have the fastest access possible to
method information.
See here for further information
on TernaryTrees.
Constructor and Description |
---|
MethodTernaryTree() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.String methodName,
java.lang.String[] signature)
Returns the method information given the method name and its signature.
|
void |
put(java.lang.String methodName,
java.lang.String[] signature,
java.lang.Object information)
Inserts in this TernaryTree the given method information, using as key the method name and its signature
|
protected int |
splitFunction(java.lang.Object obj) |
public java.lang.Object get(java.lang.String methodName, java.lang.String[] signature)
public void put(java.lang.String methodName, java.lang.String[] signature, java.lang.Object information)
protected int splitFunction(java.lang.Object obj)