01: /*
02: * Copyright (C) Chaperon. All rights reserved.
03: * -------------------------------------------------------------------------
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08:
09: package net.sourceforge.chaperon.model.pattern;
10:
11: import java.util.Vector;
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: private Vector childs = new Vector();
21:
22: /**
23: * Adds a pattern to this list
24: *
25: * @param element Pattern.
26: */
27: public void addPattern(Pattern element) {
28: if (element != null)
29: childs.addElement(element);
30: }
31:
32: /**
33: * Returns a pattern given by an index.
34: *
35: * @param index Index of the pattern
36: *
37: * @return Pattern
38: */
39: public Pattern getPattern(int index) {
40: return (Pattern) childs.elementAt(index);
41: }
42:
43: /**
44: * Return the count of pattern in this list.
45: *
46: * @return Count of pattern.
47: */
48: public int getPatternCount() {
49: return childs.size();
50: }
51: }
|