Mercurial > hg > jslab
view src/samer/silk/SilkFunction.java @ 8:5e3cbbf173aa tip
Reorganise some more
author | samer |
---|---|
date | Fri, 05 Apr 2019 22:41:58 +0100 |
parents | bf79fb79ee13 |
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()+")"; } }