public void attach ( Pipe pipe ) { // If we are in the middle of sending a message, we'll add new pipe // into the list of eligible pipes. Otherwise we add it to the list // of active pipes. if ( more ) { pipes . add ( pipe ) ; Collections . swap ( pipes , eligible , pipes . size ( ) - 1 ) ; eligible ++ ; } else { pipes . add ( pipe ) ; Collections . swap ( pipes , active , pipes . size ( ) - 1 ) ; active ++ ; eligible ++ ; } }
Adds the pipe to the distributor object .