1 2 package SOFA.SOFAnode.Made.CDL; 3 4 class CompProtBinOper extends CompProtOper { 5 public CompProtOper operand1; 6 public CompProtOper operand2; 7 public CompProtBinOper(CompProtOper operand1, CompProtOper operand2, int kind) { 8 super(kind); 9 this.operand1 = operand1; 10 this.operand2 = operand2; 11 } 12 13 public String toText() { 14 StringBuffer sb = new StringBuffer ("("); 15 String strOp=""; 16 switch (type) { 17 case CompProtKind.p_alternative: 18 strOp = ")+("; 19 break; 20 case CompProtKind.p_andparallel: 21 strOp = ")|("; 22 break; 23 case CompProtKind.p_orparallel: 24 strOp = ")||("; 25 break; 26 case CompProtKind.p_sequence: 27 strOp = ");("; 28 break; 29 case CompProtKind.p_restriction: 30 strOp = ")/("; 31 break; 32 default: break; 33 } 34 35 sb.append(operand1.toText()); 36 sb.append(strOp); 37 sb.append(operand2.toText()); 38 sb.append(")"); 39 return sb.toString(); 40 } 41 } 42 | Popular Tags |