Channel currentDest = GetIOField ("output");   ASSERT (currentDest != null); ASSERT (currentSource.GetType ().getName ().equals (currentDest.GetType ().getName ()));   SetIOField ("input", currentSource);
    void ConnectGraph ()    {        // get my source.  If I don't have one, I'm a source.        Channel currentSource = GetIOField ("input");                // a Stream should have a list of elements that it        // contains serially.  Go through this list and        // setup the connections through channels:                try        {            ListIterator childIter;            childIter = (ListIterator) streamElements.iterator ();                    while (childIter.hasNext ())            {                Stream currentStream = (Stream) childIter.next ();                                // get the next stream:                Channel currentDest = currentStream.GetIOField ("input");                                // make sure that the channels use the same data types                ASSERT (currentSource == null ^ currentDest != null);                ASSERT (currentSource == null || currentDest == null ||                        currentSource.GetType ().equals (currentDest.GetType ()));                                // now copy the currentInput into the currentOutput                if (currentDest != null)                {                    currentStream.SetIOField ("input", currentSource);                }                                currentSource = currentStream.GetIOField ("output");            }                        if (currentSource != null)            {            }        }        catch (NoSuchElementException error)        {            // this should never happen            ASSERT (false);        }    }