KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* $Id: CompExprBoolean.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 CompExprBoolean extends CompExprOper {
11   public boolean value;
12   public CompExprBoolean(boolean val) {
13     super(CompExprKind.e_boolean);
14     value = val;
15   }
16
17   public int type() { return CompExprKind.e_boolean; }
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_exprboolean(value);
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   public String JavaDoc toString() {
41     return new Boolean JavaDoc(value).toString();
42   }
43 }
44
Popular Tags