* getWorkFunctionPhase to a Pair<nFunction, isInit>
* getWorkFunctionPhase to a Pair&lt;nFunction, isInit&gt;
    public void printFilter(FilterIter filter, DataOutputStream outputStream)    {        try            {                /*                 * map maps the object returned by getInitFunctionStage and                  * getWorkFunctionPhase to a Pair<nFunction, isInit>                 */                OMap map = new OMap();                outputStream.writeBytes("  public void init ()\n  {\n");                boolean peeks = false, pops = false, pushes = false;                for (int nInitPhase = 0;                     nInitPhase < filter.getNumInitStages();                     nInitPhase++)                    {                        outputStream.writeBytes(                                                "    addInitPhase("                                                + filter.getInitPeekStage(nInitPhase)                                                + ", "                                                + filter.getInitPopStage(nInitPhase)                                                + ", "                                                + filter.getInitPushStage(nInitPhase)                                                + ", \""                                                + getName(filter.getInitFunctionStage(nInitPhase))                                                + "\");\n");                        map.insert(                                   filter.getInitFunctionStage(nInitPhase),                                   new Pair(new Integer(nInitPhase), new Boolean(true)));                        peeks |= (filter.getInitPeekStage(nInitPhase) != 0);                        pops |= (filter.getInitPopStage(nInitPhase) != 0);                        pushes |= (filter.getInitPushStage(nInitPhase) != 0);                    }                for (int nWorkPhase = 0;                     nWorkPhase < filter.getNumWorkPhases();                     nWorkPhase++)                    {                        outputStream.writeBytes(                                                "    addSteadyPhase("                                                + filter.getPeekPhase(nWorkPhase)                                                + ", "                                                + filter.getPopPhase(nWorkPhase)                                                + ", "                                                + filter.getPushPhase(nWorkPhase)                                                + ", \""                                                + getName(filter.getWorkFunctionPhase(nWorkPhase))                                                + "\");\n");                        map.insert(                                   filter.getWorkFunctionPhase(nWorkPhase),                                   new Pair(new Integer(nWorkPhase), new Boolean(false)));                        peeks |= (filter.getPeekPhase(nWorkPhase) != 0);                        pops |= (filter.getPopPhase(nWorkPhase) != 0);                        pushes |= (filter.getPushPhase(nWorkPhase) != 0);                    }                if (peeks || pops || pushes)                    {                        outputStream.writeBytes("    setIOTypes (");                        if (peeks || pops)                            {                                // cannot peek or pop but not do the other!                                assert peeks && pops;                                outputStream.writeBytes("Integer.TYPE, ");                            }                        else                            outputStream.writeBytes("null, ");                        if (pushes)                            {                                outputStream.writeBytes("Integer.TYPE);\n");                            }                        else                            {                                outputStream.writeBytes("null);\n");                            }                    }                outputStream.writeBytes("  }\n");                for (OMapIterator func = map.begin();                     !func.equals(map.end());                     func.next())                    {                        outputStream.writeBytes(                                                "  public void " + getName(func.getKey()) + " ()\n  {\n");                        int o, e, u;                        boolean isInitFunc =                            ((Boolean) ((Pair)func.getData()).getSecond())                            .booleanValue();                        int funcNum =                            ((Integer) ((Pair)func.getData()).getFirst()).intValue();                        if (isInitFunc)                            {                                e = filter.getInitPeekStage(funcNum);                                o = filter.getInitPopStage(funcNum);                                u = filter.getInitPushStage(funcNum);                            }                        else                            {                                e = filter.getPeekPhase(funcNum);                                o = filter.getPopPhase(funcNum);                                u = filter.getPushPhase(funcNum);                            }                        if (e != 0)                            outputStream.writeBytes("    input.peekInt(" + (e - 1) + ");\n");                        if (o != 0)                            {                                outputStream.writeBytes(                                                        "    for (int n = 0; n < " + o + "; n++)\n");                                outputStream.writeBytes("      input.popInt();\n");                            }                        if (u != 0)                            {                                outputStream.writeBytes(                                                        "    for (int n = 0; n < " + u + "; n++)\n");                                outputStream.writeBytes("      output.pushInt(0);\n");                            }                        outputStream.writeBytes("  }\n");                    }            }        catch (Throwable e)            {                ERROR(e);            }    }