001: /*
002: * <copyright>
003: *
004: * Copyright 1997-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026:
027: /* @generated Thu Sep 27 15:21:46 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/glm/src/org/cougaar/glm/ldm/asset/alpassets.def - DO NOT HAND EDIT */
028: package org.cougaar.glm.ldm.asset;
029:
030: import org.cougaar.planning.ldm.asset.*;
031: import java.io.ObjectOutputStream;
032: import java.io.ObjectInputStream;
033: import java.io.IOException;
034: import java.util.Vector;
035: import java.beans.PropertyDescriptor;
036: import java.beans.IndexedPropertyDescriptor;
037: import java.beans.IntrospectionException;
038:
039: public class RotaryWingAircraftWeapon extends Weapon {
040:
041: public RotaryWingAircraftWeapon() {
042: myAirVehiclePG = null;
043: myAirSelfPropulsionPG = null;
044: myContainPG = null;
045: myLiftPG = null;
046: }
047:
048: public RotaryWingAircraftWeapon(RotaryWingAircraftWeapon prototype) {
049: super (prototype);
050: myAirVehiclePG = null;
051: myAirSelfPropulsionPG = null;
052: myContainPG = null;
053: myLiftPG = null;
054: }
055:
056: /** For infrastructure only - use org.cougaar.core.domain.Factory.copyInstance instead. **/
057: public Object clone() throws CloneNotSupportedException {
058: RotaryWingAircraftWeapon _thing = (RotaryWingAircraftWeapon) super
059: .clone();
060: if (myAirVehiclePG != null)
061: _thing.setAirVehiclePG(myAirVehiclePG.lock());
062: if (myAirSelfPropulsionPG != null)
063: _thing.setAirSelfPropulsionPG(myAirSelfPropulsionPG.lock());
064: if (myContainPG != null)
065: _thing.setContainPG(myContainPG.lock());
066: if (myLiftPG != null)
067: _thing.setLiftPG(myLiftPG.lock());
068: return _thing;
069: }
070:
071: /** create an instance of the right class for copy operations **/
072: public Asset instanceForCopy() {
073: return new RotaryWingAircraftWeapon();
074: }
075:
076: /** create an instance of this prototype **/
077: public Asset createInstance() {
078: return new RotaryWingAircraftWeapon(this );
079: }
080:
081: protected void fillAllPropertyGroups(Vector v) {
082: super .fillAllPropertyGroups(v);
083: {
084: Object _tmp = getAirVehiclePG();
085: if (_tmp != null && !(_tmp instanceof Null_PG)) {
086: v.addElement(_tmp);
087: }
088: }
089: {
090: Object _tmp = getAirSelfPropulsionPG();
091: if (_tmp != null && !(_tmp instanceof Null_PG)) {
092: v.addElement(_tmp);
093: }
094: }
095: {
096: Object _tmp = getContainPG();
097: if (_tmp != null && !(_tmp instanceof Null_PG)) {
098: v.addElement(_tmp);
099: }
100: }
101: {
102: Object _tmp = getLiftPG();
103: if (_tmp != null && !(_tmp instanceof Null_PG)) {
104: v.addElement(_tmp);
105: }
106: }
107: }
108:
109: private transient AirVehiclePG myAirVehiclePG;
110:
111: public AirVehiclePG getAirVehiclePG() {
112: AirVehiclePG _tmp = (myAirVehiclePG != null) ? myAirVehiclePG
113: : (AirVehiclePG) resolvePG(AirVehiclePG.class);
114: return (_tmp == AirVehiclePG.nullPG) ? null : _tmp;
115: }
116:
117: public void setAirVehiclePG(PropertyGroup arg_AirVehiclePG) {
118: if (!(arg_AirVehiclePG instanceof AirVehiclePG))
119: throw new IllegalArgumentException(
120: "setAirVehiclePG requires a AirVehiclePG argument.");
121: myAirVehiclePG = (AirVehiclePG) arg_AirVehiclePG;
122: }
123:
124: private transient AirSelfPropulsionPG myAirSelfPropulsionPG;
125:
126: public AirSelfPropulsionPG getAirSelfPropulsionPG() {
127: AirSelfPropulsionPG _tmp = (myAirSelfPropulsionPG != null) ? myAirSelfPropulsionPG
128: : (AirSelfPropulsionPG) resolvePG(AirSelfPropulsionPG.class);
129: return (_tmp == AirSelfPropulsionPG.nullPG) ? null : _tmp;
130: }
131:
132: public void setAirSelfPropulsionPG(
133: PropertyGroup arg_AirSelfPropulsionPG) {
134: if (!(arg_AirSelfPropulsionPG instanceof AirSelfPropulsionPG))
135: throw new IllegalArgumentException(
136: "setAirSelfPropulsionPG requires a AirSelfPropulsionPG argument.");
137: myAirSelfPropulsionPG = (AirSelfPropulsionPG) arg_AirSelfPropulsionPG;
138: }
139:
140: private transient ContainPG myContainPG;
141:
142: public ContainPG getContainPG() {
143: ContainPG _tmp = (myContainPG != null) ? myContainPG
144: : (ContainPG) resolvePG(ContainPG.class);
145: return (_tmp == ContainPG.nullPG) ? null : _tmp;
146: }
147:
148: public void setContainPG(PropertyGroup arg_ContainPG) {
149: if (!(arg_ContainPG instanceof ContainPG))
150: throw new IllegalArgumentException(
151: "setContainPG requires a ContainPG argument.");
152: myContainPG = (ContainPG) arg_ContainPG;
153: }
154:
155: private transient LiftPG myLiftPG;
156:
157: public LiftPG getLiftPG() {
158: LiftPG _tmp = (myLiftPG != null) ? myLiftPG
159: : (LiftPG) resolvePG(LiftPG.class);
160: return (_tmp == LiftPG.nullPG) ? null : _tmp;
161: }
162:
163: public void setLiftPG(PropertyGroup arg_LiftPG) {
164: if (!(arg_LiftPG instanceof LiftPG))
165: throw new IllegalArgumentException(
166: "setLiftPG requires a LiftPG argument.");
167: myLiftPG = (LiftPG) arg_LiftPG;
168: }
169:
170: // generic search methods
171: public PropertyGroup getLocalPG(Class c, long t) {
172: if (AirVehiclePG.class.equals(c)) {
173: return (myAirVehiclePG == AirVehiclePG.nullPG) ? null
174: : myAirVehiclePG;
175: }
176: if (AirSelfPropulsionPG.class.equals(c)) {
177: return (myAirSelfPropulsionPG == AirSelfPropulsionPG.nullPG) ? null
178: : myAirSelfPropulsionPG;
179: }
180: if (ContainPG.class.equals(c)) {
181: return (myContainPG == ContainPG.nullPG) ? null
182: : myContainPG;
183: }
184: if (LiftPG.class.equals(c)) {
185: return (myLiftPG == LiftPG.nullPG) ? null : myLiftPG;
186: }
187: return super .getLocalPG(c, t);
188: }
189:
190: public PropertyGroupSchedule getLocalPGSchedule(Class c) {
191: return super .getLocalPGSchedule(c);
192: }
193:
194: public void setLocalPG(Class c, PropertyGroup pg) {
195: if (AirVehiclePG.class.equals(c)) {
196: myAirVehiclePG = (AirVehiclePG) pg;
197: } else if (AirSelfPropulsionPG.class.equals(c)) {
198: myAirSelfPropulsionPG = (AirSelfPropulsionPG) pg;
199: } else if (ContainPG.class.equals(c)) {
200: myContainPG = (ContainPG) pg;
201: } else if (LiftPG.class.equals(c)) {
202: myLiftPG = (LiftPG) pg;
203: } else
204: super .setLocalPG(c, pg);
205: }
206:
207: public void setLocalPGSchedule(PropertyGroupSchedule pgSchedule) {
208: super .setLocalPGSchedule(pgSchedule);
209: }
210:
211: public PropertyGroup removeLocalPG(Class c) {
212: PropertyGroup removed = null;
213: if (AirVehiclePG.class.equals(c)) {
214: removed = myAirVehiclePG;
215: myAirVehiclePG = null;
216: } else if (AirSelfPropulsionPG.class.equals(c)) {
217: removed = myAirSelfPropulsionPG;
218: myAirSelfPropulsionPG = null;
219: } else if (ContainPG.class.equals(c)) {
220: removed = myContainPG;
221: myContainPG = null;
222: } else if (LiftPG.class.equals(c)) {
223: removed = myLiftPG;
224: myLiftPG = null;
225: } else {
226: removed = super .removeLocalPG(c);
227: }
228: return removed;
229: }
230:
231: public PropertyGroup removeLocalPG(PropertyGroup pg) {
232: Class pgc = pg.getPrimaryClass();
233: if (AirVehiclePG.class.equals(pgc)) {
234: PropertyGroup removed = myAirVehiclePG;
235: myAirVehiclePG = null;
236: return removed;
237: } else if (AirSelfPropulsionPG.class.equals(pgc)) {
238: PropertyGroup removed = myAirSelfPropulsionPG;
239: myAirSelfPropulsionPG = null;
240: return removed;
241: } else if (ContainPG.class.equals(pgc)) {
242: PropertyGroup removed = myContainPG;
243: myContainPG = null;
244: return removed;
245: } else if (LiftPG.class.equals(pgc)) {
246: PropertyGroup removed = myLiftPG;
247: myLiftPG = null;
248: return removed;
249: } else {
250: }
251: return super .removeLocalPG(pg);
252: }
253:
254: public PropertyGroupSchedule removeLocalPGSchedule(Class c) {
255: {
256: return super .removeLocalPGSchedule(c);
257: }
258: }
259:
260: public PropertyGroup generateDefaultPG(Class c) {
261: if (AirVehiclePG.class.equals(c)) {
262: return (myAirVehiclePG = new AirVehiclePGImpl());
263: } else if (AirSelfPropulsionPG.class.equals(c)) {
264: return (myAirSelfPropulsionPG = new AirSelfPropulsionPGImpl());
265: } else if (ContainPG.class.equals(c)) {
266: return (myContainPG = new ContainPGImpl());
267: } else if (LiftPG.class.equals(c)) {
268: return (myLiftPG = new LiftPGImpl());
269: } else
270: return super .generateDefaultPG(c);
271: }
272:
273: // dumb serialization methods
274:
275: private void writeObject(ObjectOutputStream out) throws IOException {
276: out.defaultWriteObject();
277: if (myAirVehiclePG instanceof Null_PG
278: || myAirVehiclePG instanceof Future_PG) {
279: out.writeObject(null);
280: } else {
281: out.writeObject(myAirVehiclePG);
282: }
283: if (myAirSelfPropulsionPG instanceof Null_PG
284: || myAirSelfPropulsionPG instanceof Future_PG) {
285: out.writeObject(null);
286: } else {
287: out.writeObject(myAirSelfPropulsionPG);
288: }
289: if (myContainPG instanceof Null_PG
290: || myContainPG instanceof Future_PG) {
291: out.writeObject(null);
292: } else {
293: out.writeObject(myContainPG);
294: }
295: if (myLiftPG instanceof Null_PG
296: || myLiftPG instanceof Future_PG) {
297: out.writeObject(null);
298: } else {
299: out.writeObject(myLiftPG);
300: }
301: }
302:
303: private void readObject(ObjectInputStream in)
304: throws ClassNotFoundException, IOException {
305: in.defaultReadObject();
306: myAirVehiclePG = (AirVehiclePG) in.readObject();
307: myAirSelfPropulsionPG = (AirSelfPropulsionPG) in.readObject();
308: myContainPG = (ContainPG) in.readObject();
309: myLiftPG = (LiftPG) in.readObject();
310: }
311:
312: // beaninfo support
313: private static PropertyDescriptor properties[];
314: static {
315: try {
316: properties = new PropertyDescriptor[4];
317: properties[0] = new PropertyDescriptor("AirVehiclePG",
318: RotaryWingAircraftWeapon.class, "getAirVehiclePG",
319: null);
320: properties[1] = new PropertyDescriptor(
321: "AirSelfPropulsionPG",
322: RotaryWingAircraftWeapon.class,
323: "getAirSelfPropulsionPG", null);
324: properties[2] = new PropertyDescriptor("ContainPG",
325: RotaryWingAircraftWeapon.class, "getContainPG",
326: null);
327: properties[3] = new PropertyDescriptor("LiftPG",
328: RotaryWingAircraftWeapon.class, "getLiftPG", null);
329: } catch (IntrospectionException ie) {
330: }
331: }
332:
333: public PropertyDescriptor[] getPropertyDescriptors() {
334: PropertyDescriptor[] pds = super .getPropertyDescriptors();
335: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length + 4];
336: System.arraycopy(pds, 0, ps, 0, pds.length);
337: System.arraycopy(properties, 0, ps, pds.length, 4);
338: return ps;
339: }
340: }
|