1public
2class TraceFunction
3 implements RealFunction
4{
5 private
6 RealFunction f;
7
8 public
9 TraceFunction(RealFunction f) {
10 this.f = f;
11 }
12
13 public
14 double at(double x) {
15 double y = f.at(x);
16
17 System.out.println(
18 f + " at " + x +"\t= " + y);
19
20 return
21 y;
22 }
23
24 public
25 String toString() {
26 return
27 f.toString();
28 }
29}
30