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