public ExpressionWriter list()

in src/main/java/net/hydromatic/linq4j/expressions/ExpressionWriter.java [157:189]


  public ExpressionWriter list(String begin, String sep, String end,
      Iterable<?> list) {
    final Iterator<?> iterator = list.iterator();
    if (iterator.hasNext()) {
      begin(begin);
      for (;;) {
        Object o = iterator.next();
        if (o instanceof Expression) {
          ((Expression) o).accept(this, 0, 0);
        } else if (o instanceof MemberDeclaration) {
          ((MemberDeclaration) o).accept(this);
        } else if (o instanceof Type) {
          append((Type) o);
        } else {
          append(o);
        }
        if (!iterator.hasNext()) {
          break;
        }
        buf.append(sep);
        if (sep.endsWith("\n")) {
          indentPending = true;
        }
      }
      end(end);
    } else {
      while (begin.endsWith("\n")) {
        begin = begin.substring(0, begin.length() - 1);
      }
      buf.append(begin).append(end);
    }
    return this;
  }