mx4j.util

Class MethodTernaryTree

public class MethodTernaryTree extends Object

Specialized ternary tree for method metadata information.

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.

Version: $Revision: 1.3 $

Method Summary
Objectget(String methodName, String[] signature)
Returns the method information given the method name and its signature.
voidput(String methodName, String[] signature, Object information)
Inserts in this TernaryTree the given method information, using as key the method name and its signature
protected intsplitFunction(Object obj)

Method Detail

get

public Object get(String methodName, String[] signature)
Returns the method information given the method name and its signature.

See Also: MethodTernaryTree

put

public void put(String methodName, String[] signature, Object information)
Inserts in this TernaryTree the given method information, using as key the method name and its signature

See Also: MethodTernaryTree

splitFunction

protected int splitFunction(Object obj)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.