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:47 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/glm/src/org/cougaar/glm/ldm/asset/alpprops.def - DO NOT HAND EDIT */
028: /** Implementation of GroundSelfPropulsionPG.
029: * @see GroundSelfPropulsionPG
030: * @see NewGroundSelfPropulsionPG
031: **/package org.cougaar.glm.ldm.asset;
032:
033: import org.cougaar.planning.ldm.measure.*;
034: import org.cougaar.planning.ldm.asset.*;
035: import org.cougaar.planning.ldm.plan.*;
036: import java.util.*;
037:
038: import org.cougaar.glm.ldm.plan.*;
039: import org.cougaar.glm.ldm.oplan.*;
040: import org.cougaar.glm.ldm.policy.*;
041: import org.cougaar.core.mts.MessageAddress;
042: import org.cougaar.glm.execution.common.InventoryReport;
043:
044: import java.io.ObjectOutputStream;
045: import java.io.ObjectInputStream;
046: import java.io.IOException;
047: import java.beans.PropertyDescriptor;
048: import java.beans.IndexedPropertyDescriptor;
049:
050: public class GroundSelfPropulsionPGImpl extends
051: java.beans.SimpleBeanInfo implements NewGroundSelfPropulsionPG,
052: Cloneable {
053: public GroundSelfPropulsionPGImpl() {
054: }
055:
056: // Slots
057:
058: private String theTractionType;
059:
060: public String getTractionType() {
061: return theTractionType;
062: }
063:
064: public void setTractionType(String traction_type) {
065: theTractionType = traction_type;
066: }
067:
068: private Volume theFuelConsumptionPerMile;
069:
070: public Volume getFuelConsumptionPerMile() {
071: return theFuelConsumptionPerMile;
072: }
073:
074: public void setFuelConsumptionPerMile(
075: Volume fuel_consumption_per_mile) {
076: theFuelConsumptionPerMile = fuel_consumption_per_mile;
077: }
078:
079: private String theEngineType;
080:
081: public String getEngineType() {
082: return theEngineType;
083: }
084:
085: public void setEngineType(String engine_type) {
086: theEngineType = engine_type;
087: }
088:
089: private String theFuelType;
090:
091: public String getFuelType() {
092: return theFuelType;
093: }
094:
095: public void setFuelType(String fuel_type) {
096: theFuelType = fuel_type;
097: }
098:
099: private Speed theMaximumSpeed;
100:
101: public Speed getMaximumSpeed() {
102: return theMaximumSpeed;
103: }
104:
105: public void setMaximumSpeed(Speed maximum_speed) {
106: theMaximumSpeed = maximum_speed;
107: }
108:
109: private Speed theCruiseSpeed;
110:
111: public Speed getCruiseSpeed() {
112: return theCruiseSpeed;
113: }
114:
115: public void setCruiseSpeed(Speed cruise_speed) {
116: theCruiseSpeed = cruise_speed;
117: }
118:
119: private Distance theFullPayloadRange;
120:
121: public Distance getFullPayloadRange() {
122: return theFullPayloadRange;
123: }
124:
125: public void setFullPayloadRange(Distance full_payload_range) {
126: theFullPayloadRange = full_payload_range;
127: }
128:
129: private Distance theEmptyPayloadRange;
130:
131: public Distance getEmptyPayloadRange() {
132: return theEmptyPayloadRange;
133: }
134:
135: public void setEmptyPayloadRange(Distance empty_payload_range) {
136: theEmptyPayloadRange = empty_payload_range;
137: }
138:
139: public GroundSelfPropulsionPGImpl(GroundSelfPropulsionPG original) {
140: theTractionType = original.getTractionType();
141: theFuelConsumptionPerMile = original
142: .getFuelConsumptionPerMile();
143: theEngineType = original.getEngineType();
144: theFuelType = original.getFuelType();
145: theMaximumSpeed = original.getMaximumSpeed();
146: theCruiseSpeed = original.getCruiseSpeed();
147: theFullPayloadRange = original.getFullPayloadRange();
148: theEmptyPayloadRange = original.getEmptyPayloadRange();
149: }
150:
151: public boolean equals(Object other) {
152:
153: if (!(other instanceof GroundSelfPropulsionPG)) {
154: return false;
155: }
156:
157: GroundSelfPropulsionPG otherGroundSelfPropulsionPG = (GroundSelfPropulsionPG) other;
158:
159: if (getTractionType() == null) {
160: if (otherGroundSelfPropulsionPG.getTractionType() != null) {
161: return false;
162: }
163: } else if (!(getTractionType()
164: .equals(otherGroundSelfPropulsionPG.getTractionType()))) {
165: return false;
166: }
167:
168: if (getFuelConsumptionPerMile() == null) {
169: if (otherGroundSelfPropulsionPG.getFuelConsumptionPerMile() != null) {
170: return false;
171: }
172: } else if (!(getFuelConsumptionPerMile()
173: .equals(otherGroundSelfPropulsionPG
174: .getFuelConsumptionPerMile()))) {
175: return false;
176: }
177:
178: if (getEngineType() == null) {
179: if (otherGroundSelfPropulsionPG.getEngineType() != null) {
180: return false;
181: }
182: } else if (!(getEngineType().equals(otherGroundSelfPropulsionPG
183: .getEngineType()))) {
184: return false;
185: }
186:
187: if (getFuelType() == null) {
188: if (otherGroundSelfPropulsionPG.getFuelType() != null) {
189: return false;
190: }
191: } else if (!(getFuelType().equals(otherGroundSelfPropulsionPG
192: .getFuelType()))) {
193: return false;
194: }
195:
196: if (getMaximumSpeed() == null) {
197: if (otherGroundSelfPropulsionPG.getMaximumSpeed() != null) {
198: return false;
199: }
200: } else if (!(getMaximumSpeed()
201: .equals(otherGroundSelfPropulsionPG.getMaximumSpeed()))) {
202: return false;
203: }
204:
205: if (getCruiseSpeed() == null) {
206: if (otherGroundSelfPropulsionPG.getCruiseSpeed() != null) {
207: return false;
208: }
209: } else if (!(getCruiseSpeed()
210: .equals(otherGroundSelfPropulsionPG.getCruiseSpeed()))) {
211: return false;
212: }
213:
214: if (getFullPayloadRange() == null) {
215: if (otherGroundSelfPropulsionPG.getFullPayloadRange() != null) {
216: return false;
217: }
218: } else if (!(getFullPayloadRange()
219: .equals(otherGroundSelfPropulsionPG
220: .getFullPayloadRange()))) {
221: return false;
222: }
223:
224: if (getEmptyPayloadRange() == null) {
225: if (otherGroundSelfPropulsionPG.getEmptyPayloadRange() != null) {
226: return false;
227: }
228: } else if (!(getEmptyPayloadRange()
229: .equals(otherGroundSelfPropulsionPG
230: .getEmptyPayloadRange()))) {
231: return false;
232: }
233:
234: return true;
235: }
236:
237: public boolean hasDataQuality() {
238: return false;
239: }
240:
241: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
242: return null;
243: }
244:
245: // static inner extension class for real DataQuality Support
246: public final static class DQ extends GroundSelfPropulsionPGImpl
247: implements org.cougaar.planning.ldm.dq.NewHasDataQuality {
248: public DQ() {
249: super ();
250: }
251:
252: public DQ(GroundSelfPropulsionPG original) {
253: super (original);
254: }
255:
256: public Object clone() {
257: return new DQ(this );
258: }
259:
260: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
261:
262: public boolean hasDataQuality() {
263: return (_dq != null);
264: }
265:
266: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
267: return _dq;
268: }
269:
270: public void setDataQuality(
271: org.cougaar.planning.ldm.dq.DataQuality dq) {
272: _dq = dq;
273: }
274:
275: private void writeObject(ObjectOutputStream out)
276: throws IOException {
277: out.defaultWriteObject();
278: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
279: out.writeObject(_dq);
280: }
281:
282: private void readObject(ObjectInputStream in)
283: throws ClassNotFoundException, IOException {
284: in.defaultReadObject();
285: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
286: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
287: .readObject();
288: }
289:
290: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
291: static {
292: try {
293: properties[0] = new PropertyDescriptor("dataQuality",
294: DQ.class, "getDataQuality", null);
295: } catch (Exception e) {
296: e.printStackTrace();
297: }
298: }
299:
300: public PropertyDescriptor[] getPropertyDescriptors() {
301: PropertyDescriptor[] pds = super .properties;
302: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
303: + properties.length];
304: System.arraycopy(pds, 0, ps, 0, pds.length);
305: System.arraycopy(properties, 0, ps, pds.length,
306: properties.length);
307: return ps;
308: }
309: }
310:
311: private transient GroundSelfPropulsionPG _locked = null;
312:
313: public PropertyGroup lock(Object key) {
314: if (_locked == null)
315: _locked = new _Locked(key);
316: return _locked;
317: }
318:
319: public PropertyGroup lock() {
320: return lock(null);
321: }
322:
323: public NewPropertyGroup unlock(Object key) {
324: return this ;
325: }
326:
327: public Object clone() throws CloneNotSupportedException {
328: return new GroundSelfPropulsionPGImpl(
329: GroundSelfPropulsionPGImpl.this );
330: }
331:
332: public PropertyGroup copy() {
333: try {
334: return (PropertyGroup) clone();
335: } catch (CloneNotSupportedException cnse) {
336: return null;
337: }
338: }
339:
340: public Class getPrimaryClass() {
341: return primaryClass;
342: }
343:
344: public String getAssetGetMethod() {
345: return assetGetter;
346: }
347:
348: public String getAssetSetMethod() {
349: return assetSetter;
350: }
351:
352: private final static PropertyDescriptor properties[] = new PropertyDescriptor[8];
353: static {
354: try {
355: properties[0] = new PropertyDescriptor("traction_type",
356: GroundSelfPropulsionPG.class, "getTractionType",
357: null);
358: properties[1] = new PropertyDescriptor(
359: "fuel_consumption_per_mile",
360: GroundSelfPropulsionPG.class,
361: "getFuelConsumptionPerMile", null);
362: properties[2] = new PropertyDescriptor("engine_type",
363: GroundSelfPropulsionPG.class, "getEngineType", null);
364: properties[3] = new PropertyDescriptor("fuel_type",
365: GroundSelfPropulsionPG.class, "getFuelType", null);
366: properties[4] = new PropertyDescriptor("maximum_speed",
367: GroundSelfPropulsionPG.class, "getMaximumSpeed",
368: null);
369: properties[5] = new PropertyDescriptor("cruise_speed",
370: GroundSelfPropulsionPG.class, "getCruiseSpeed",
371: null);
372: properties[6] = new PropertyDescriptor(
373: "full_payload_range", GroundSelfPropulsionPG.class,
374: "getFullPayloadRange", null);
375: properties[7] = new PropertyDescriptor(
376: "empty_payload_range",
377: GroundSelfPropulsionPG.class,
378: "getEmptyPayloadRange", null);
379: } catch (Exception e) {
380: org.cougaar.util.log.Logging.getLogger(
381: GroundSelfPropulsionPG.class).error(
382: "Caught exception", e);
383: }
384: }
385:
386: public PropertyDescriptor[] getPropertyDescriptors() {
387: return properties;
388: }
389:
390: private final class _Locked extends java.beans.SimpleBeanInfo
391: implements GroundSelfPropulsionPG, Cloneable, LockedPG {
392: private transient Object theKey = null;
393:
394: _Locked(Object key) {
395: if (this .theKey == null)
396: this .theKey = key;
397: }
398:
399: public _Locked() {
400: }
401:
402: public PropertyGroup lock() {
403: return this ;
404: }
405:
406: public PropertyGroup lock(Object o) {
407: return this ;
408: }
409:
410: public NewPropertyGroup unlock(Object key)
411: throws IllegalAccessException {
412: if (theKey.equals(key)) {
413: return GroundSelfPropulsionPGImpl.this ;
414: } else {
415: throw new IllegalAccessException(
416: "unlock: mismatched internal and provided keys!");
417: }
418: }
419:
420: public PropertyGroup copy() {
421: try {
422: return (PropertyGroup) clone();
423: } catch (CloneNotSupportedException cnse) {
424: return null;
425: }
426: }
427:
428: public Object clone() throws CloneNotSupportedException {
429: return new GroundSelfPropulsionPGImpl(
430: GroundSelfPropulsionPGImpl.this );
431: }
432:
433: public boolean equals(Object object) {
434: return GroundSelfPropulsionPGImpl.this .equals(object);
435: }
436:
437: public String getTractionType() {
438: return GroundSelfPropulsionPGImpl.this .getTractionType();
439: }
440:
441: public Volume getFuelConsumptionPerMile() {
442: return GroundSelfPropulsionPGImpl.this
443: .getFuelConsumptionPerMile();
444: }
445:
446: public String getEngineType() {
447: return GroundSelfPropulsionPGImpl.this .getEngineType();
448: }
449:
450: public String getFuelType() {
451: return GroundSelfPropulsionPGImpl.this .getFuelType();
452: }
453:
454: public Speed getMaximumSpeed() {
455: return GroundSelfPropulsionPGImpl.this .getMaximumSpeed();
456: }
457:
458: public Speed getCruiseSpeed() {
459: return GroundSelfPropulsionPGImpl.this .getCruiseSpeed();
460: }
461:
462: public Distance getFullPayloadRange() {
463: return GroundSelfPropulsionPGImpl.this
464: .getFullPayloadRange();
465: }
466:
467: public Distance getEmptyPayloadRange() {
468: return GroundSelfPropulsionPGImpl.this
469: .getEmptyPayloadRange();
470: }
471:
472: public final boolean hasDataQuality() {
473: return GroundSelfPropulsionPGImpl.this .hasDataQuality();
474: }
475:
476: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
477: return GroundSelfPropulsionPGImpl.this .getDataQuality();
478: }
479:
480: public Class getPrimaryClass() {
481: return primaryClass;
482: }
483:
484: public String getAssetGetMethod() {
485: return assetGetter;
486: }
487:
488: public String getAssetSetMethod() {
489: return assetSetter;
490: }
491:
492: public PropertyDescriptor[] getPropertyDescriptors() {
493: return properties;
494: }
495:
496: public Class getIntrospectionClass() {
497: return GroundSelfPropulsionPGImpl.class;
498: }
499:
500: }
501:
502: }
|