KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* $Id: CompExprString.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 CompExprString extends CompExprOper {
11   public String JavaDoc value;
12   public CompExprString(String JavaDoc val) {
13     super(CompExprKind.e_string);
14     value = val;
15   }
16
17   public int type() { return CompExprKind.e_string; }
18   public boolean isProp() { return false; }
19
20   public EnumList nameProp(CompRepository rep) throws CDLExceptRemote, CDLExceptLock {
21     EnumList l = new EnumList();
22     return l;
23   }
24
25   public int isPositive() {
26     return -2;
27   }
28
29   public ExprOperDef toNormal(CDLRepository rep) throws CDLExceptToNormal, CDLExceptRemote, CDLExceptLock {
30     try {
31       return ((Repository) rep.get_containing_repository()).create_exprstring(value);
32     } catch (RemoteException JavaDoc e) {
33       throw new CDLExceptRemote("Remote exception occured: "+e.getMessage());
34     } catch (TIRExceptCreate ecr) {
35       throw new CDLExceptToNormal("Can't create expression");
36     }
37   }
38
39   public String JavaDoc toString() {
40     return value;
41   }
42 }
43
Popular Tags