Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/hartmath/mapping/Size1Function.java


1   /*
2    *  --- formatted by Jindent 2.0b2, (www.c-lab.de/~jindent) ---
3    */
4   package com.hartmath.mapping;
5   import com.hartmath.expression.HObject;
6   import com.hartmath.expression.HFunction;
7   
8   /**
9    *  Class that represents a function evaluation object. FunctionMapper is used
10   *  as an interface for built-in functions, which are associated with a symbol.
11   *
12   *@author     Klaus Hartlage <A HREF="mailto:khartlage@t-online.de">
13   *      khartlage@t-online.de</A>
14   *@created    31. Juli 2001
15   *@see        HSymbol
16   *@version    %I%, %G%
17   */
18  public class Size1Function extends FunctionMapper {
19  
20    /**
21     *  Constructor for the Size1Function object
22     *
23     *@param  uFun  Description of Parameter
24     */
25    public Size1Function(UnaryFunction uFun) {
26      super(Size1TypeX.FUNCTION, uFun);
27    }
28  
29  
30    /**
31     *  Evaluate the given function if possible.
32     *
33     *@param  fun  the function, which should be evaluated
34     *@return      <c>null</c> if the function could not be evaluated; the
35     *      evaluated object otherwise
36     */
37    public HObject evaluate(HFunction fun) {
38      if (uPredicate.execute(fun)) {
39        return uFunction.execute((HFunction) fun.get(0));
40      }
41      return null;
42    }
43  }
44  
45  
46  /*
47   *  --- formatting done in "Sun Java Convention" style on 06-18-1999 ---
48   */