KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnode > Made > CDL > CompExprFixed


1 /* $Id: CompExprFixed.java,v 1.2 2004/05/20 14:23:51 bures Exp $ */
2 package SOFA.SOFAnode.Made.CDL;
3 import java.rmi.RemoteException JavaDoc;
4
5 import SOFA.SOFAnode.Made.TIR.CDLRepository;
6 import SOFA.SOFAnode.Made.TIR.ExprOperDef;
7 import SOFA.SOFAnode.Made.TIR.Repository;
8 import SOFA.SOFAnode.Made.TIR.TIRExceptCreate;
9
10 class CompExprFixed extends CompExprOper {
11   public Fixed value;
12   public CompExprFixed(Fixed val) {
13     super(CompExprKind.e_fixed);
14     value = val;
15   }
16
17   public int type() { return CompExprKind.e_fixed; }
18
19   public boolean isProp() { return false; }
20
21   public EnumList nameProp(CompRepository rep) throws CDLExceptRemote, CDLExceptLock {
22     EnumList l = new EnumList();
23     return l;
24   }
25
26   public int isPositive() {
27     return -2;
28   }
29
30   public ExprOperDef toNormal(CDLRepository rep) throws CDLExceptToNormal, CDLExceptRemote, CDLExceptLock {
31     try {
32       return ((Repository) rep.get_containing_repository()).create_exprfixed(new java.math.BigDecimal JavaDoc(value.number), value.total, value.fract);
33     } catch (RemoteException JavaDoc e) {
34       throw new CDLExceptRemote("Remote exception occured: "+e.getMessage());
35     } catch (TIRExceptCreate ecr) {
36       throw new CDLExceptToNormal("Can't create expression");
37     }
38   }
39 }
40
Popular Tags