01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.models.impl.metabossmodel.enterprisemodel;
16:
17: import java.util.Collection;
18: import java.util.Iterator;
19:
20: import org.netbeans.mdr.storagemodel.StorableObject;
21:
22: import com.metaboss.sdlctools.models.impl.metabossmodel.ModelElementImpl;
23:
24: public abstract class EnterpriseImpl extends ModelElementImpl
25: implements
26: com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Enterprise {
27: // Required constructor
28: protected EnterpriseImpl(StorableObject storable) {
29: super (storable);
30: }
31:
32: /**
33: * @param pSystemName
34: * @return requested System or throws exception if none found
35: */
36: public com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System getSystem(
37: String pSystemName) {
38: com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System lFoundSystem = findSystem(pSystemName);
39: // Throw exception if nothing found
40: if (lFoundSystem == null)
41: throw new IllegalArgumentException(
42: "Unable to locate System named '" + pSystemName
43: + "' in System. SystemRef: " + getRef());
44: return lFoundSystem;
45: }
46:
47: /**
48: * @param pSystemName
49: * @return requested System or null if none found
50: */
51: public com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System findSystem(
52: String pSystemName) {
53: Collection lSystems = getSystems();
54: if (!lSystems.isEmpty()) {
55: for (Iterator lSystemsIterator = lSystems.iterator(); lSystemsIterator
56: .hasNext();) {
57: com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System lSystem = (com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System) lSystemsIterator
58: .next();
59: if (lSystem.getName().equals(pSystemName))
60: return lSystem;
61: }
62: }
63: return null;
64: }
65: }
|