public String toString() {
    StringBuffer result = new StringBuffer();
    if (getTupleType().equals("I") || getTupleType().equals("Z")) {
      int i = intTupleToInt(this);
      result.append(i);
    }
    else {
      result.append(getTupleType());
      result.append("(");
      boolean first = true;
      for (ValueExpression el : elements) {
        if (!first) { result.append(", "); }
        result.append(el.toString());
        first = false;
      }
      result.append(")");
    }
    return result.toString();
  }