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