1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.struts.flow.core.source.impl.validity;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.Iterator;
22 import java.util.List;
23
24 import org.apache.struts.flow.core.source.SourceValidity;
25
26 /***
27 * The base class for the aggregation implementations
28 *
29 * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
30 * @version CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:17 $
31 */
32 public abstract class AbstractAggregatedValidity
33 implements SourceValidity
34 {
35 final ArrayList m_list = new ArrayList();
36
37 public void add( final SourceValidity validity )
38 {
39 m_list.add( validity );
40 }
41
42 public String toString()
43 {
44 final StringBuffer sb = new StringBuffer( "SourceValidity " );
45 for( final Iterator i = m_list.iterator(); i.hasNext(); )
46 {
47 sb.append( i.next() );
48 if( i.hasNext() ) sb.append( ':' );
49 }
50 return sb.toString();
51 }
52
53 public List getValidities()
54 {
55 return Collections.unmodifiableList(m_list);
56 }
57
58 SourceValidity getValidity(final int index)
59 {
60 return (SourceValidity) m_list.get(index);
61 }
62
63 }