01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer: Florent BENOIT
22: * --------------------------------------------------------------------------
23: * $Id: Tasks.java 6896 2005-06-07 08:21:28Z pelletib $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas.ant.jonasbase;
26:
27: import java.util.ArrayList;
28: import java.util.Iterator;
29: import java.util.List;
30:
31: import org.apache.tools.ant.Task;
32:
33: /**
34: * @author Florent Benoit
35: */
36: public class Tasks {
37:
38: /**
39: * List of tasks
40: */
41: private List tasks = null;
42:
43: /**
44: * Default constructor
45: */
46: public Tasks() {
47: tasks = new ArrayList();
48: }
49:
50: /**
51: * Add a task to the list of defined tasks
52: * @param task to add
53: */
54: public void addTask(Task task) {
55: tasks.add(task);
56: }
57:
58: /**
59: * @return a list of all tasks to do
60: */
61: public List getTasks() {
62: return tasks;
63: }
64:
65: /**
66: * Add several tasks
67: * @param subTasks some tasks to do
68: */
69: public void addTasks(Tasks subTasks) {
70: if (subTasks != null) {
71: for (Iterator it = subTasks.getTasks().iterator(); it
72: .hasNext();) {
73: addTask((Task) it.next());
74: }
75: }
76: }
77:
78: /**
79: * Add several tasks
80: * @param tasks some tasks to do
81: */
82: public void addTasks(List tasks) {
83: if (tasks != null) {
84: for (Iterator it = tasks.iterator(); it.hasNext();) {
85: addTask((Task) it.next());
86: }
87: }
88: }
89: }
|