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 CargoRotaryWingAircraft extends CargoVehicle {
040:
041: public CargoRotaryWingAircraft() {
042: myLiftPG = null;
043: myAirVehiclePG = null;
044: myAirSelfPropulsionPG = null;
045: }
046:
047: public CargoRotaryWingAircraft(CargoRotaryWingAircraft prototype) {
048: super (prototype);
049: myLiftPG = null;
050: myAirVehiclePG = null;
051: myAirSelfPropulsionPG = null;
052: }
053:
054: /** For infrastructure only - use org.cougaar.core.domain.Factory.copyInstance instead. **/
055: public Object clone() throws CloneNotSupportedException {
056: CargoRotaryWingAircraft _thing = (CargoRotaryWingAircraft) super
057: .clone();
058: if (myLiftPG != null)
059: _thing.setLiftPG(myLiftPG.lock());
060: if (myAirVehiclePG != null)
061: _thing.setAirVehiclePG(myAirVehiclePG.lock());
062: if (myAirSelfPropulsionPG != null)
063: _thing.setAirSelfPropulsionPG(myAirSelfPropulsionPG.lock());
064: return _thing;
065: }
066:
067: /** create an instance of the right class for copy operations **/
068: public Asset instanceForCopy() {
069: return new CargoRotaryWingAircraft();
070: }
071:
072: /** create an instance of this prototype **/
073: public Asset createInstance() {
074: return new CargoRotaryWingAircraft(this );
075: }
076:
077: protected void fillAllPropertyGroups(Vector v) {
078: super .fillAllPropertyGroups(v);
079: {
080: Object _tmp = getLiftPG();
081: if (_tmp != null && !(_tmp instanceof Null_PG)) {
082: v.addElement(_tmp);
083: }
084: }
085: {
086: Object _tmp = getAirVehiclePG();
087: if (_tmp != null && !(_tmp instanceof Null_PG)) {
088: v.addElement(_tmp);
089: }
090: }
091: {
092: Object _tmp = getAirSelfPropulsionPG();
093: if (_tmp != null && !(_tmp instanceof Null_PG)) {
094: v.addElement(_tmp);
095: }
096: }
097: }
098:
099: private transient LiftPG myLiftPG;
100:
101: public LiftPG getLiftPG() {
102: LiftPG _tmp = (myLiftPG != null) ? myLiftPG
103: : (LiftPG) resolvePG(LiftPG.class);
104: return (_tmp == LiftPG.nullPG) ? null : _tmp;
105: }
106:
107: public void setLiftPG(PropertyGroup arg_LiftPG) {
108: if (!(arg_LiftPG instanceof LiftPG))
109: throw new IllegalArgumentException(
110: "setLiftPG requires a LiftPG argument.");
111: myLiftPG = (LiftPG) arg_LiftPG;
112: }
113:
114: private transient AirVehiclePG myAirVehiclePG;
115:
116: public AirVehiclePG getAirVehiclePG() {
117: AirVehiclePG _tmp = (myAirVehiclePG != null) ? myAirVehiclePG
118: : (AirVehiclePG) resolvePG(AirVehiclePG.class);
119: return (_tmp == AirVehiclePG.nullPG) ? null : _tmp;
120: }
121:
122: public void setAirVehiclePG(PropertyGroup arg_AirVehiclePG) {
123: if (!(arg_AirVehiclePG instanceof AirVehiclePG))
124: throw new IllegalArgumentException(
125: "setAirVehiclePG requires a AirVehiclePG argument.");
126: myAirVehiclePG = (AirVehiclePG) arg_AirVehiclePG;
127: }
128:
129: private transient AirSelfPropulsionPG myAirSelfPropulsionPG;
130:
131: public AirSelfPropulsionPG getAirSelfPropulsionPG() {
132: AirSelfPropulsionPG _tmp = (myAirSelfPropulsionPG != null) ? myAirSelfPropulsionPG
133: : (AirSelfPropulsionPG) resolvePG(AirSelfPropulsionPG.class);
134: return (_tmp == AirSelfPropulsionPG.nullPG) ? null : _tmp;
135: }
136:
137: public void setAirSelfPropulsionPG(
138: PropertyGroup arg_AirSelfPropulsionPG) {
139: if (!(arg_AirSelfPropulsionPG instanceof AirSelfPropulsionPG))
140: throw new IllegalArgumentException(
141: "setAirSelfPropulsionPG requires a AirSelfPropulsionPG argument.");
142: myAirSelfPropulsionPG = (AirSelfPropulsionPG) arg_AirSelfPropulsionPG;
143: }
144:
145: // generic search methods
146: public PropertyGroup getLocalPG(Class c, long t) {
147: if (LiftPG.class.equals(c)) {
148: return (myLiftPG == LiftPG.nullPG) ? null : myLiftPG;
149: }
150: if (AirVehiclePG.class.equals(c)) {
151: return (myAirVehiclePG == AirVehiclePG.nullPG) ? null
152: : myAirVehiclePG;
153: }
154: if (AirSelfPropulsionPG.class.equals(c)) {
155: return (myAirSelfPropulsionPG == AirSelfPropulsionPG.nullPG) ? null
156: : myAirSelfPropulsionPG;
157: }
158: return super .getLocalPG(c, t);
159: }
160:
161: public PropertyGroupSchedule getLocalPGSchedule(Class c) {
162: return super .getLocalPGSchedule(c);
163: }
164:
165: public void setLocalPG(Class c, PropertyGroup pg) {
166: if (LiftPG.class.equals(c)) {
167: myLiftPG = (LiftPG) pg;
168: } else if (AirVehiclePG.class.equals(c)) {
169: myAirVehiclePG = (AirVehiclePG) pg;
170: } else if (AirSelfPropulsionPG.class.equals(c)) {
171: myAirSelfPropulsionPG = (AirSelfPropulsionPG) pg;
172: } else
173: super .setLocalPG(c, pg);
174: }
175:
176: public void setLocalPGSchedule(PropertyGroupSchedule pgSchedule) {
177: super .setLocalPGSchedule(pgSchedule);
178: }
179:
180: public PropertyGroup removeLocalPG(Class c) {
181: PropertyGroup removed = null;
182: if (LiftPG.class.equals(c)) {
183: removed = myLiftPG;
184: myLiftPG = null;
185: } else if (AirVehiclePG.class.equals(c)) {
186: removed = myAirVehiclePG;
187: myAirVehiclePG = null;
188: } else if (AirSelfPropulsionPG.class.equals(c)) {
189: removed = myAirSelfPropulsionPG;
190: myAirSelfPropulsionPG = null;
191: } else {
192: removed = super .removeLocalPG(c);
193: }
194: return removed;
195: }
196:
197: public PropertyGroup removeLocalPG(PropertyGroup pg) {
198: Class pgc = pg.getPrimaryClass();
199: if (LiftPG.class.equals(pgc)) {
200: PropertyGroup removed = myLiftPG;
201: myLiftPG = null;
202: return removed;
203: } else if (AirVehiclePG.class.equals(pgc)) {
204: PropertyGroup removed = myAirVehiclePG;
205: myAirVehiclePG = null;
206: return removed;
207: } else if (AirSelfPropulsionPG.class.equals(pgc)) {
208: PropertyGroup removed = myAirSelfPropulsionPG;
209: myAirSelfPropulsionPG = null;
210: return removed;
211: } else {
212: }
213: return super .removeLocalPG(pg);
214: }
215:
216: public PropertyGroupSchedule removeLocalPGSchedule(Class c) {
217: {
218: return super .removeLocalPGSchedule(c);
219: }
220: }
221:
222: public PropertyGroup generateDefaultPG(Class c) {
223: if (LiftPG.class.equals(c)) {
224: return (myLiftPG = new LiftPGImpl());
225: } else if (AirVehiclePG.class.equals(c)) {
226: return (myAirVehiclePG = new AirVehiclePGImpl());
227: } else if (AirSelfPropulsionPG.class.equals(c)) {
228: return (myAirSelfPropulsionPG = new AirSelfPropulsionPGImpl());
229: } else
230: return super .generateDefaultPG(c);
231: }
232:
233: // dumb serialization methods
234:
235: private void writeObject(ObjectOutputStream out) throws IOException {
236: out.defaultWriteObject();
237: if (myLiftPG instanceof Null_PG
238: || myLiftPG instanceof Future_PG) {
239: out.writeObject(null);
240: } else {
241: out.writeObject(myLiftPG);
242: }
243: if (myAirVehiclePG instanceof Null_PG
244: || myAirVehiclePG instanceof Future_PG) {
245: out.writeObject(null);
246: } else {
247: out.writeObject(myAirVehiclePG);
248: }
249: if (myAirSelfPropulsionPG instanceof Null_PG
250: || myAirSelfPropulsionPG instanceof Future_PG) {
251: out.writeObject(null);
252: } else {
253: out.writeObject(myAirSelfPropulsionPG);
254: }
255: }
256:
257: private void readObject(ObjectInputStream in)
258: throws ClassNotFoundException, IOException {
259: in.defaultReadObject();
260: myLiftPG = (LiftPG) in.readObject();
261: myAirVehiclePG = (AirVehiclePG) in.readObject();
262: myAirSelfPropulsionPG = (AirSelfPropulsionPG) in.readObject();
263: }
264:
265: // beaninfo support
266: private static PropertyDescriptor properties[];
267: static {
268: try {
269: properties = new PropertyDescriptor[3];
270: properties[0] = new PropertyDescriptor("LiftPG",
271: CargoRotaryWingAircraft.class, "getLiftPG", null);
272: properties[1] = new PropertyDescriptor("AirVehiclePG",
273: CargoRotaryWingAircraft.class, "getAirVehiclePG",
274: null);
275: properties[2] = new PropertyDescriptor(
276: "AirSelfPropulsionPG",
277: CargoRotaryWingAircraft.class,
278: "getAirSelfPropulsionPG", null);
279: } catch (IntrospectionException ie) {
280: }
281: }
282:
283: public PropertyDescriptor[] getPropertyDescriptors() {
284: PropertyDescriptor[] pds = super .getPropertyDescriptors();
285: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length + 3];
286: System.arraycopy(pds, 0, ps, 0, pds.length);
287: System.arraycopy(properties, 0, ps, pds.length, 3);
288: return ps;
289: }
290: }
|