コード例 #1
0
ファイル: MCmdOpEnter.java プロジェクト: stormymauldin/stuff
 /**
  * Returns a string that can be read and executed by the USE shell achieving the same effect of
  * this command.
  */
 public String getUSEcmd() {
   MOperation op = fOpCall.operation();
   return "!openter "
       + fOpCall.target()
       + " "
       + op.name()
       + "("
       + StringUtil.fmtSeq(fOpCall.argExprs(), ",")
       + ")";
 }
コード例 #2
0
ファイル: VarDeclList.java プロジェクト: stormymauldin/stuff
 public String toString() {
   String res = "";
   if (fAllHaveSameType) {
     Iterator it = fVarDecls.iterator();
     while (it.hasNext()) {
       VarDecl decl = (VarDecl) it.next();
       res += decl.name();
       if (it.hasNext()) res += ", ";
       else res += " : " + decl.type();
     }
   } else res = StringUtil.fmtSeq(fVarDecls.iterator(), ", ");
   return res;
 }
コード例 #3
0
  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();

    sb.append(fAssociationClassName);
    if (fLinkObjectName != null) {
      sb.append(" ");
      sb.append(fLinkObjectName);
    }
    sb.append(" between (");

    StringUtil.fmtSeqWithSubSeq(sb, fParticipants, ",", qualifierValues, ",", "{", "}");

    sb.append(")");

    return sb.toString();
  }
コード例 #4
0
  @Override
  protected MStatement generateStatement() throws CompilationFailedException {

    MAssociationClass associationClass =
        fContext.model().getAssociationClass(fAssociationClassName.toString());

    if (associationClass == null) {
      throw new CompilationFailedException(
          this,
          "Association class "
              + StringUtil.inQuotes(fAssociationClassName.toString())
              + " does not exist.");
    }

    List<MRValue> participants = generateAssociationParticipants(associationClass, fParticipants);

    List<List<MRValue>> qualifierRValues;
    if (this.qualifierValues == null || this.qualifierValues.isEmpty()) {
      qualifierRValues = Collections.emptyList();
    } else {
      qualifierRValues = new ArrayList<List<MRValue>>();

      for (List<ASTRValue> endQualifierValues : this.qualifierValues) {
        List<MRValue> endQualifierRValues;

        if (endQualifierValues == null || endQualifierValues.isEmpty()) {
          endQualifierRValues = Collections.emptyList();
        } else {
          endQualifierRValues = new ArrayList<MRValue>();

          for (ASTRValue value : endQualifierValues) {
            endQualifierRValues.add(this.generateRValue(value));
          }
        }
        qualifierRValues.add(endQualifierRValues);
      }
    }

    return new MNewLinkObjectStatement(
        associationClass,
        participants,
        qualifierRValues,
        (fLinkObjectName == null ? null : generateStringExpression(fLinkObjectName)));
  }
コード例 #5
0
 public String toString() {
   return "(" + fOp + " " + StringUtil.fmtSeq(fArgs.iterator(), " ") + ")";
 }