KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lsmp > djep > matrixJep > nodeTypes > ASTMConstant


1 /* @author rich
2  * Created on 01-Feb-2004
3  *
4  * This code is covered by a Creative Commons
5  * Attribution, Non Commercial, Share Alike license
6  * <a HREF="http://creativecommons.org/licenses/by-nc-sa/1.0">License</a>
7  */

8 package org.lsmp.djep.matrixJep.nodeTypes;
9 import org.nfunk.jep.*;
10 import org.lsmp.djep.vectorJep.*;
11 import org.lsmp.djep.vectorJep.values.*;
12
13 /**
14  * Holds a single constant number.
15  * @author Rich Morris
16  * Created on 01-Feb-2004
17  */

18 public class ASTMConstant extends ASTConstant implements MatrixNodeI
19 {
20     private Scaler scalerval;
21
22     public ASTMConstant(int i)
23     {
24         super(i);
25         scalerval = new Scaler();
26     }
27     public Dimensions getDim() {
28         return Dimensions.ONE;
29     }
30
31     public MatrixValueI getMValue() {
32         return scalerval;
33     }
34
35     public Object JavaDoc getValue() {
36         return scalerval.getEle(0);
37     }
38
39     public void setValue(Object JavaDoc val) {
40         scalerval.setEle(0,val);
41     }
42     
43 }
44
Popular Tags