prepareToWork();
    public void executeNextPhase(String schedName)    {        assert multiPhaseStyle;        int inputCount=0, outputCount=0;        if (input != null)        {            inputCount = input.getItemsPopped();        }        if (output != null)        {            outputCount = output.getItemsPushed();        }        PhaseInfo phase;        if (initPhase < initPhases.size())        {            phase = (PhaseInfo) initPhases.get(initPhase);            initPhase++;        }        else        {            phase = (PhaseInfo) steadyPhases.get(steadyPhase);            steadyPhase = (steadyPhase + 1) % steadyPhases.size();        }        // make sure that the next phase to execute is the one asked for!        assert schedName.equals(phase.name);        // make sure that there is enough data to peek!        assert input == null            || input.getItemsPushed() - input.getItemsPopped() >= phase.e;        // execute the phase        try        {            if (schedName.equals ("work")) work (); else            if (schedName.equals ("prework")) prework (); else            getClass().getMethod(phase.name, null).invoke(this, null);        }        catch (Throwable x)        {            ERROR(x);        }        int newInputCount, newOutputCount;        if (input != null)        {            newInputCount = input.getItemsPopped();            if (newInputCount - inputCount != phase.o)                throw new IllegalArgumentException(                "This probably means that you declared the wrong pop rate for "                    + this                    + "\n  have newInput=="                    + newInputCount                    + " and inputCount=="                    + inputCount                    + " and popCount=="                    + phase.o                    + " on Stream "                    + this);        }        if (output != null)        {            newOutputCount = output.getItemsPushed();            if (newOutputCount - outputCount != phase.u)                throw new IllegalArgumentException(                "This probably means that you declared the wrong push rate for "                    + this                    + "\n"                    + "Pushed: "                    + newOutputCount                    + " and outputCount: "                    + outputCount                    + " but declared: "                    + phase.u                    + " on Stream "                    + this);        }    }