FileDocCategorySizeDatePackage
Calculator.javaAPI DocExample566Mon Mar 08 22:35:16 GMT 2004javathreads.examples.ch05.example4

Calculator

public abstract class Calculator extends Object

Fields Summary
private static ThreadLocal
results
Constructors Summary
Methods Summary
public java.lang.Objectcalculate(java.lang.Object param)


        
        HashMap hm = results.get();
	Object o = hm.get(param);
	if (o != null)
	    return o;
        o = doLocalCalculate(param);
        hm.put(param, o);
        return o;
    
protected abstract java.lang.ObjectdoLocalCalculate(java.lang.Object param)