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 AirConditionPG.
029: * @see AirConditionPG
030: * @see NewAirConditionPG
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 AirConditionPGImpl extends java.beans.SimpleBeanInfo
051: implements NewAirConditionPG, Cloneable {
052: public AirConditionPGImpl() {
053: }
054:
055: // Slots
056:
057: private Distance theCeiling;
058:
059: public Distance getCeiling() {
060: return theCeiling;
061: }
062:
063: public void setCeiling(Distance ceiling) {
064: theCeiling = ceiling;
065: }
066:
067: private Speed theWindSpeed;
068:
069: public Speed getWindSpeed() {
070: return theWindSpeed;
071: }
072:
073: public void setWindSpeed(Speed wind_speed) {
074: theWindSpeed = wind_speed;
075: }
076:
077: private Temperature theTemperature;
078:
079: public Temperature getTemperature() {
080: return theTemperature;
081: }
082:
083: public void setTemperature(Temperature temperature) {
084: theTemperature = temperature;
085: }
086:
087: private double thePrecipitationRate;
088:
089: public double getPrecipitationRate() {
090: return thePrecipitationRate;
091: }
092:
093: public void setPrecipitationRate(double precipitation_rate) {
094: thePrecipitationRate = precipitation_rate;
095: }
096:
097: private Heading theWindHeading;
098:
099: public Heading getWindHeading() {
100: return theWindHeading;
101: }
102:
103: public void setWindHeading(Heading wind_heading) {
104: theWindHeading = wind_heading;
105: }
106:
107: private Distance theVisibility;
108:
109: public Distance getVisibility() {
110: return theVisibility;
111: }
112:
113: public void setVisibility(Distance visibility) {
114: theVisibility = visibility;
115: }
116:
117: private double theBarometricPressure;
118:
119: public double getBarometricPressure() {
120: return theBarometricPressure;
121: }
122:
123: public void setBarometricPressure(double barometric_pressure) {
124: theBarometricPressure = barometric_pressure;
125: }
126:
127: public AirConditionPGImpl(AirConditionPG original) {
128: theCeiling = original.getCeiling();
129: theWindSpeed = original.getWindSpeed();
130: theTemperature = original.getTemperature();
131: thePrecipitationRate = original.getPrecipitationRate();
132: theWindHeading = original.getWindHeading();
133: theVisibility = original.getVisibility();
134: theBarometricPressure = original.getBarometricPressure();
135: }
136:
137: public boolean equals(Object other) {
138:
139: if (!(other instanceof AirConditionPG)) {
140: return false;
141: }
142:
143: AirConditionPG otherAirConditionPG = (AirConditionPG) other;
144:
145: if (getCeiling() == null) {
146: if (otherAirConditionPG.getCeiling() != null) {
147: return false;
148: }
149: } else if (!(getCeiling().equals(otherAirConditionPG
150: .getCeiling()))) {
151: return false;
152: }
153:
154: if (getWindSpeed() == null) {
155: if (otherAirConditionPG.getWindSpeed() != null) {
156: return false;
157: }
158: } else if (!(getWindSpeed().equals(otherAirConditionPG
159: .getWindSpeed()))) {
160: return false;
161: }
162:
163: if (getTemperature() == null) {
164: if (otherAirConditionPG.getTemperature() != null) {
165: return false;
166: }
167: } else if (!(getTemperature().equals(otherAirConditionPG
168: .getTemperature()))) {
169: return false;
170: }
171:
172: if (!(getPrecipitationRate() == otherAirConditionPG
173: .getPrecipitationRate())) {
174: return false;
175: }
176:
177: if (getWindHeading() == null) {
178: if (otherAirConditionPG.getWindHeading() != null) {
179: return false;
180: }
181: } else if (!(getWindHeading().equals(otherAirConditionPG
182: .getWindHeading()))) {
183: return false;
184: }
185:
186: if (getVisibility() == null) {
187: if (otherAirConditionPG.getVisibility() != null) {
188: return false;
189: }
190: } else if (!(getVisibility().equals(otherAirConditionPG
191: .getVisibility()))) {
192: return false;
193: }
194:
195: if (!(getBarometricPressure() == otherAirConditionPG
196: .getBarometricPressure())) {
197: return false;
198: }
199:
200: return true;
201: }
202:
203: public boolean hasDataQuality() {
204: return false;
205: }
206:
207: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
208: return null;
209: }
210:
211: // static inner extension class for real DataQuality Support
212: public final static class DQ extends AirConditionPGImpl implements
213: org.cougaar.planning.ldm.dq.NewHasDataQuality {
214: public DQ() {
215: super ();
216: }
217:
218: public DQ(AirConditionPG original) {
219: super (original);
220: }
221:
222: public Object clone() {
223: return new DQ(this );
224: }
225:
226: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
227:
228: public boolean hasDataQuality() {
229: return (_dq != null);
230: }
231:
232: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
233: return _dq;
234: }
235:
236: public void setDataQuality(
237: org.cougaar.planning.ldm.dq.DataQuality dq) {
238: _dq = dq;
239: }
240:
241: private void writeObject(ObjectOutputStream out)
242: throws IOException {
243: out.defaultWriteObject();
244: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
245: out.writeObject(_dq);
246: }
247:
248: private void readObject(ObjectInputStream in)
249: throws ClassNotFoundException, IOException {
250: in.defaultReadObject();
251: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
252: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
253: .readObject();
254: }
255:
256: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
257: static {
258: try {
259: properties[0] = new PropertyDescriptor("dataQuality",
260: DQ.class, "getDataQuality", null);
261: } catch (Exception e) {
262: e.printStackTrace();
263: }
264: }
265:
266: public PropertyDescriptor[] getPropertyDescriptors() {
267: PropertyDescriptor[] pds = super .properties;
268: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
269: + properties.length];
270: System.arraycopy(pds, 0, ps, 0, pds.length);
271: System.arraycopy(properties, 0, ps, pds.length,
272: properties.length);
273: return ps;
274: }
275: }
276:
277: private transient AirConditionPG _locked = null;
278:
279: public PropertyGroup lock(Object key) {
280: if (_locked == null)
281: _locked = new _Locked(key);
282: return _locked;
283: }
284:
285: public PropertyGroup lock() {
286: return lock(null);
287: }
288:
289: public NewPropertyGroup unlock(Object key) {
290: return this ;
291: }
292:
293: public Object clone() throws CloneNotSupportedException {
294: return new AirConditionPGImpl(AirConditionPGImpl.this );
295: }
296:
297: public PropertyGroup copy() {
298: try {
299: return (PropertyGroup) clone();
300: } catch (CloneNotSupportedException cnse) {
301: return null;
302: }
303: }
304:
305: public Class getPrimaryClass() {
306: return primaryClass;
307: }
308:
309: public String getAssetGetMethod() {
310: return assetGetter;
311: }
312:
313: public String getAssetSetMethod() {
314: return assetSetter;
315: }
316:
317: private final static PropertyDescriptor properties[] = new PropertyDescriptor[7];
318: static {
319: try {
320: properties[0] = new PropertyDescriptor("ceiling",
321: AirConditionPG.class, "getCeiling", null);
322: properties[1] = new PropertyDescriptor("wind_speed",
323: AirConditionPG.class, "getWindSpeed", null);
324: properties[2] = new PropertyDescriptor("temperature",
325: AirConditionPG.class, "getTemperature", null);
326: properties[3] = new PropertyDescriptor(
327: "precipitation_rate", AirConditionPG.class,
328: "getPrecipitationRate", null);
329: properties[4] = new PropertyDescriptor("wind_heading",
330: AirConditionPG.class, "getWindHeading", null);
331: properties[5] = new PropertyDescriptor("visibility",
332: AirConditionPG.class, "getVisibility", null);
333: properties[6] = new PropertyDescriptor(
334: "barometric_pressure", AirConditionPG.class,
335: "getBarometricPressure", null);
336: } catch (Exception e) {
337: org.cougaar.util.log.Logging
338: .getLogger(AirConditionPG.class).error(
339: "Caught exception", e);
340: }
341: }
342:
343: public PropertyDescriptor[] getPropertyDescriptors() {
344: return properties;
345: }
346:
347: private final class _Locked extends java.beans.SimpleBeanInfo
348: implements AirConditionPG, Cloneable, LockedPG {
349: private transient Object theKey = null;
350:
351: _Locked(Object key) {
352: if (this .theKey == null)
353: this .theKey = key;
354: }
355:
356: public _Locked() {
357: }
358:
359: public PropertyGroup lock() {
360: return this ;
361: }
362:
363: public PropertyGroup lock(Object o) {
364: return this ;
365: }
366:
367: public NewPropertyGroup unlock(Object key)
368: throws IllegalAccessException {
369: if (theKey.equals(key)) {
370: return AirConditionPGImpl.this ;
371: } else {
372: throw new IllegalAccessException(
373: "unlock: mismatched internal and provided keys!");
374: }
375: }
376:
377: public PropertyGroup copy() {
378: try {
379: return (PropertyGroup) clone();
380: } catch (CloneNotSupportedException cnse) {
381: return null;
382: }
383: }
384:
385: public Object clone() throws CloneNotSupportedException {
386: return new AirConditionPGImpl(AirConditionPGImpl.this );
387: }
388:
389: public boolean equals(Object object) {
390: return AirConditionPGImpl.this .equals(object);
391: }
392:
393: public Distance getCeiling() {
394: return AirConditionPGImpl.this .getCeiling();
395: }
396:
397: public Speed getWindSpeed() {
398: return AirConditionPGImpl.this .getWindSpeed();
399: }
400:
401: public Temperature getTemperature() {
402: return AirConditionPGImpl.this .getTemperature();
403: }
404:
405: public double getPrecipitationRate() {
406: return AirConditionPGImpl.this .getPrecipitationRate();
407: }
408:
409: public Heading getWindHeading() {
410: return AirConditionPGImpl.this .getWindHeading();
411: }
412:
413: public Distance getVisibility() {
414: return AirConditionPGImpl.this .getVisibility();
415: }
416:
417: public double getBarometricPressure() {
418: return AirConditionPGImpl.this .getBarometricPressure();
419: }
420:
421: public final boolean hasDataQuality() {
422: return AirConditionPGImpl.this .hasDataQuality();
423: }
424:
425: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
426: return AirConditionPGImpl.this .getDataQuality();
427: }
428:
429: public Class getPrimaryClass() {
430: return primaryClass;
431: }
432:
433: public String getAssetGetMethod() {
434: return assetGetter;
435: }
436:
437: public String getAssetSetMethod() {
438: return assetSetter;
439: }
440:
441: public PropertyDescriptor[] getPropertyDescriptors() {
442: return properties;
443: }
444:
445: public Class getIntrospectionClass() {
446: return AirConditionPGImpl.class;
447: }
448:
449: }
450:
451: }
|