Assuming you want to know how to implement such a thing: it is called a "pipeline pattern". If this is not homework, you can reuse the existing implementation of this template. One of them is available at:
http://code.google.com/p/pipelinepattern/
If this is homework, then your teacher can expect you to write it yourself from scratch. A good starting point is this two-stage pipeline (where one thread reads lines from a file and another stream prints lines):
http://rosettacode.org/wiki/Synchronous_concurrency#Java
In the above example, the two steps interact through a BlockingQueue (i.e., step 1 writes to the queue, and step 2 reads it). If stage 1 is consistently faster than stage 2, the queue will be quite large). You can activate the steps in lockstep using the SynchronousQueue instead [see Comment # 1 on this answer, for what].
If you need a five-stage conveyor, you need to expand it with 5 threads that have 4 queues between them:
in -> [s1] -> q12 -> [s2] -> q23 -> [s3] -> q34 -> [s4] -> q45 -> [s5] -> out
Above, each [s*] represents a stage (stream), and each qAB represents a queue ending in [sA] and unloaded from [sB]
source share