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