01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id$
23: */
24: package com.bostechcorp.cbesb.common.util.project;
25:
26: import java.util.Collection;
27: import java.util.HashMap;
28: import java.util.Iterator;
29: import java.util.Map;
30:
31: public class ProjectBean {
32:
33: private String name;
34:
35: private String type;
36:
37: private Map<String, SubProjectBean> SubProjectsMap = new HashMap();
38:
39: public String getName() {
40: return name;
41: }
42:
43: public void setName(String name) {
44: this .name = name;
45: }
46:
47: public Map<String, SubProjectBean> getSubProjectsMap() {
48: return SubProjectsMap;
49: }
50:
51: public void setSubProjectsMap(
52: Map<String, SubProjectBean> subProjectsMap) {
53: SubProjectsMap = subProjectsMap;
54: }
55:
56: public String getType() {
57: return type;
58: }
59:
60: public void setType(String type) {
61: this .type = type;
62: }
63:
64: public void addNewSubProject(String name, String type) {
65: SubProjectBean newProject = new SubProjectBean(name, type);
66: SubProjectsMap.put(name, newProject);
67: }
68:
69: public void removeSubproject(String name) {
70: SubProjectsMap.remove(name);
71: }
72:
73: public void addNewSubProject(SubProjectBean newProject) {
74: SubProjectsMap.put(newProject.getName(), newProject);
75: }
76:
77: public SubProjectBean[] getAllSubProjects() {
78: SubProjectBean[] subProjects = new SubProjectBean[SubProjectsMap
79: .size()];
80: Collection collection = SubProjectsMap.values();
81: Iterator iterator = collection.iterator();
82: int index = 0;
83: while (iterator.hasNext()) {
84: subProjects[index] = (SubProjectBean) iterator.next();
85: index++;
86: }
87: return subProjects;
88: }
89:
90: public ProjectBean(String name, String type) {
91: this .name = name;
92: this .type = type;
93: }
94:
95: public ProjectBean() {
96:
97: }
98: }
|