KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > chaperon > model > pattern > PatternList


1 /*
2  * Copyright (C) Chaperon. 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 file.
7  */

8
9 package net.sourceforge.chaperon.model.pattern;
10
11 import java.util.Vector JavaDoc;
12
13 /**
14  * This class represents a abstract list of pattern.
15  *
16  * @author <a HREF="mailto:stephan@apache.org">Stephan Michels</a>
17  * @version CVS $Id: PatternList.java,v 1.3 2003/12/09 19:55:53 benedikta Exp $
18  */

19 public abstract class PatternList extends Pattern
20 {
21   private Vector JavaDoc childs = new Vector JavaDoc();
22
23   /**
24    * Adds a pattern to this list
25    *
26    * @param element Pattern.
27    */

28   public void addPattern(Pattern element)
29   {
30     if (element!=null)
31       childs.addElement(element);
32   }
33
34   /**
35    * Returns a pattern given by an index.
36    *
37    * @param index Index of the pattern
38    *
39    * @return Pattern
40    */

41   public Pattern getPattern(int index)
42   {
43     return (Pattern)childs.elementAt(index);
44   }
45
46   /**
47    * Return the count of pattern in this list.
48    *
49    * @return Count of pattern.
50    */

51   public int getPatternCount()
52   {
53     return childs.size();
54   }
55 }
56
Popular Tags