KickJava   Java API By Example, From Geeks To Geeks.

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


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