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