KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* $Id: CompProtOperand.java,v 1.1.1.1 2003/02/11 16:19:40 bures Exp $ */
2 package SOFA.SOFAnode.Made.CDL;
3
4 class CompProtOperand extends CompProtOper{
5   public int mode;
6   public String JavaDoc operand; // name of operation
7
public String JavaDoc ifacename; // name of interface (is used only in frame prot)
8

9   public CompProtOperand(String JavaDoc operand, String JavaDoc ifacename, int mode) {
10     super(CompProtKind.p_operand);
11     this.operand = operand;
12     this.ifacename = ifacename;
13     this.mode = mode;
14   }
15
16   public String JavaDoc toText() {
17     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
18     if (mode == CompProtMode.pm_none) { // iface protocol
19
sb.append(operand);
20     } else { // frame protocol
21
if (mode == CompProtMode.pm_in)
22         sb.append("?");
23       else
24         sb.append("!");
25       sb.append(ifacename);
26       sb.append(".");
27       sb.append(operand);
28     }
29     return sb.toString();
30   }
31 }
32
Popular Tags