Mercurial > hg > jslab
view src/samer/silk/SilkFunction.java @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
line wrap: on
line source
package samer.silk; import java.util.*; import jsint.*; public class SilkFunction extends samer.maths.Function { Procedure fn; public SilkFunction(Procedure fn) { this.fn=fn; } public double apply( double t) { Object[] args = { new Double(t) }; Object res = fn.apply(args); return ((Number)res).doubleValue(); } public String format( String arg) { return "("+fn.getName()+")"; } }