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 CargoFixedWingAircraft extends CargoVehicle {
040:
041: public CargoFixedWingAircraft() {
042: myAirLiftPG = null;
043: myAirVehiclePG = null;
044: myAirSelfPropulsionPG = null;
045: }
046:
047: public CargoFixedWingAircraft(CargoFixedWingAircraft prototype) {
048: super (prototype);
049: myAirLiftPG = 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: CargoFixedWingAircraft _thing = (CargoFixedWingAircraft) super
057: .clone();
058: if (myAirLiftPG != null)
059: _thing.setAirLiftPG(myAirLiftPG.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 CargoFixedWingAircraft();
070: }
071:
072: /** create an instance of this prototype **/
073: public Asset createInstance() {
074: return new CargoFixedWingAircraft(this );
075: }
076:
077: protected void fillAllPropertyGroups(Vector v) {
078: super .fillAllPropertyGroups(v);
079: {
080: Object _tmp = getAirLiftPG();
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 AirLiftPG myAirLiftPG;
100:
101: public AirLiftPG getAirLiftPG() {
102: AirLiftPG _tmp = (myAirLiftPG != null) ? myAirLiftPG
103: : (AirLiftPG) resolvePG(AirLiftPG.class);
104: return (_tmp == AirLiftPG.nullPG) ? null : _tmp;
105: }
106:
107: public void setAirLiftPG(PropertyGroup arg_AirLiftPG) {
108: if (!(arg_AirLiftPG instanceof AirLiftPG))
109: throw new IllegalArgumentException(
110: "setAirLiftPG requires a AirLiftPG argument.");
111: myAirLiftPG = (AirLiftPG) arg_AirLiftPG;
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 (AirLiftPG.class.equals(c)) {
148: return (myAirLiftPG == AirLiftPG.nullPG) ? null
149: : myAirLiftPG;
150: }
151: if (AirVehiclePG.class.equals(c)) {
152: return (myAirVehiclePG == AirVehiclePG.nullPG) ? null
153: : myAirVehiclePG;
154: }
155: if (AirSelfPropulsionPG.class.equals(c)) {
156: return (myAirSelfPropulsionPG == AirSelfPropulsionPG.nullPG) ? null
157: : myAirSelfPropulsionPG;
158: }
159: return super .getLocalPG(c, t);
160: }
161:
162: public PropertyGroupSchedule getLocalPGSchedule(Class c) {
163: return super .getLocalPGSchedule(c);
164: }
165:
166: public void setLocalPG(Class c, PropertyGroup pg) {
167: if (AirLiftPG.class.equals(c)) {
168: myAirLiftPG = (AirLiftPG) pg;
169: } else if (AirVehiclePG.class.equals(c)) {
170: myAirVehiclePG = (AirVehiclePG) pg;
171: } else if (AirSelfPropulsionPG.class.equals(c)) {
172: myAirSelfPropulsionPG = (AirSelfPropulsionPG) pg;
173: } else
174: super .setLocalPG(c, pg);
175: }
176:
177: public void setLocalPGSchedule(PropertyGroupSchedule pgSchedule) {
178: super .setLocalPGSchedule(pgSchedule);
179: }
180:
181: public PropertyGroup removeLocalPG(Class c) {
182: PropertyGroup removed = null;
183: if (AirLiftPG.class.equals(c)) {
184: removed = myAirLiftPG;
185: myAirLiftPG = null;
186: } else if (AirVehiclePG.class.equals(c)) {
187: removed = myAirVehiclePG;
188: myAirVehiclePG = null;
189: } else if (AirSelfPropulsionPG.class.equals(c)) {
190: removed = myAirSelfPropulsionPG;
191: myAirSelfPropulsionPG = null;
192: } else {
193: removed = super .removeLocalPG(c);
194: }
195: return removed;
196: }
197:
198: public PropertyGroup removeLocalPG(PropertyGroup pg) {
199: Class pgc = pg.getPrimaryClass();
200: if (AirLiftPG.class.equals(pgc)) {
201: PropertyGroup removed = myAirLiftPG;
202: myAirLiftPG = null;
203: return removed;
204: } else if (AirVehiclePG.class.equals(pgc)) {
205: PropertyGroup removed = myAirVehiclePG;
206: myAirVehiclePG = null;
207: return removed;
208: } else if (AirSelfPropulsionPG.class.equals(pgc)) {
209: PropertyGroup removed = myAirSelfPropulsionPG;
210: myAirSelfPropulsionPG = null;
211: return removed;
212: } else {
213: }
214: return super .removeLocalPG(pg);
215: }
216:
217: public PropertyGroupSchedule removeLocalPGSchedule(Class c) {
218: {
219: return super .removeLocalPGSchedule(c);
220: }
221: }
222:
223: public PropertyGroup generateDefaultPG(Class c) {
224: if (AirLiftPG.class.equals(c)) {
225: return (myAirLiftPG = new AirLiftPGImpl());
226: } else if (AirVehiclePG.class.equals(c)) {
227: return (myAirVehiclePG = new AirVehiclePGImpl());
228: } else if (AirSelfPropulsionPG.class.equals(c)) {
229: return (myAirSelfPropulsionPG = new AirSelfPropulsionPGImpl());
230: } else
231: return super .generateDefaultPG(c);
232: }
233:
234: // dumb serialization methods
235:
236: private void writeObject(ObjectOutputStream out) throws IOException {
237: out.defaultWriteObject();
238: if (myAirLiftPG instanceof Null_PG
239: || myAirLiftPG instanceof Future_PG) {
240: out.writeObject(null);
241: } else {
242: out.writeObject(myAirLiftPG);
243: }
244: if (myAirVehiclePG instanceof Null_PG
245: || myAirVehiclePG instanceof Future_PG) {
246: out.writeObject(null);
247: } else {
248: out.writeObject(myAirVehiclePG);
249: }
250: if (myAirSelfPropulsionPG instanceof Null_PG
251: || myAirSelfPropulsionPG instanceof Future_PG) {
252: out.writeObject(null);
253: } else {
254: out.writeObject(myAirSelfPropulsionPG);
255: }
256: }
257:
258: private void readObject(ObjectInputStream in)
259: throws ClassNotFoundException, IOException {
260: in.defaultReadObject();
261: myAirLiftPG = (AirLiftPG) in.readObject();
262: myAirVehiclePG = (AirVehiclePG) in.readObject();
263: myAirSelfPropulsionPG = (AirSelfPropulsionPG) in.readObject();
264: }
265:
266: // beaninfo support
267: private static PropertyDescriptor properties[];
268: static {
269: try {
270: properties = new PropertyDescriptor[3];
271: properties[0] = new PropertyDescriptor("AirLiftPG",
272: CargoFixedWingAircraft.class, "getAirLiftPG", null);
273: properties[1] = new PropertyDescriptor("AirVehiclePG",
274: CargoFixedWingAircraft.class, "getAirVehiclePG",
275: null);
276: properties[2] = new PropertyDescriptor(
277: "AirSelfPropulsionPG",
278: CargoFixedWingAircraft.class,
279: "getAirSelfPropulsionPG", null);
280: } catch (IntrospectionException ie) {
281: }
282: }
283:
284: public PropertyDescriptor[] getPropertyDescriptors() {
285: PropertyDescriptor[] pds = super .getPropertyDescriptors();
286: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length + 3];
287: System.arraycopy(pds, 0, ps, 0, pds.length);
288: System.arraycopy(properties, 0, ps, pds.length, 3);
289: return ps;
290: }
291: }
|