result.append("}\n");
result.append(indent + "}\n");
    private String maybeGenerateConstruct(StreamSpec spec)    {        StringBuffer result = new StringBuffer();                // The StreamSpec at this point has no parameters; we need to        // find the parameters of the init function.        Function init = spec.getInitFunc();        // (ASSERT: init != null)        List params = init.getParams();                // In the library path, generate the __construct() mechanism:        if (libraryFormat)        {            // Generate fields for each of the parameters.            for (Iterator iter = params.iterator(); iter.hasNext(); )            {                Parameter param = (Parameter)iter.next();                result.append(indent + "private " +                              convertType(param.getType()) +                              " __param_" + param.getName() + ";\n");            }            // Generate a __construct() method that saves these.            result.append(indent + "public static " + spec.getName() +                          " __construct(");            boolean first = true;            for (Iterator iter = params.iterator(); iter.hasNext(); )            {                Parameter param = (Parameter)iter.next();                if (!first) result.append(", ");                first = false;                result.append(convertType(param.getType()) + " " +                              param.getName());            }            result.append(")\n" + indent + "{\n");            addIndent();            result.append(indent + spec.getName() + " __obj = new " +                          spec.getName() + "();\n");            for (Iterator iter = params.iterator(); iter.hasNext(); )            {                Parameter param = (Parameter)iter.next();                String name = param.getName();                result.append(indent + "__obj.__param_" + name + " = " +                              name + ";\n");            }            result.append(indent + "return __obj;\n");            unIndent();            result.append("}\n");                        // Generate a callInit() method.            result.append(indent + "protected void callInit()\n" +                          indent + "{\n");            addIndent();            result.append(indent + "init(");            first = true;            for (Iterator iter = params.iterator(); iter.hasNext(); )            {                Parameter param = (Parameter)iter.next();                if (!first) result.append(", ");                first = false;                result.append("__param_" + param.getName());            }            result.append(");\n");            unIndent();            result.append("}\n");        }        // In the compiler path, generate an empty constructor.        else // (!libraryFormat)        {            result.append(indent + "public " + spec.getName() + "(");            boolean first = true;            for (Iterator iter = params.iterator(); iter.hasNext(); )            {                Parameter param = (Parameter)iter.next();                if (!first) result.append(", ");                first = false;                result.append(convertType(param.getType()) + " " +                              param.getName());            }            result.append(")\n" + indent + "{\n" + indent + "}\n");        }                return result.toString();    }