KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > pipeline > ProcessorPipeline


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.pipeline;
9
10 import java.util.Iterator JavaDoc;
11
12 /**
13  * This represents a pipeline made up of stages.
14  *
15  * @author <a HREF="mailto:peter@apache.org">Peter Donald</a>
16  */

17 public class ProcessorPipeline
18     extends DefaultPipeline
19     implements ProcessorStage
20 {
21     public void process( final Object JavaDoc object )
22     {
23         final Iterator JavaDoc stages = m_stages.iterator();
24
25         while( stages.hasNext() )
26         {
27             ((ProcessorStage)stages.next()).process( object );
28         }
29     }
30
31     public Stage getStage( final int index )
32     {
33         return (Stage)m_stages.get( index );
34     }
35
36     public int getSize()
37     {
38         return m_stages.size();
39     }
40 }
41
Popular Tags