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 MidAirRefuelPG.
029: * @see MidAirRefuelPG
030: * @see NewMidAirRefuelPG
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 MidAirRefuelPGImpl extends java.beans.SimpleBeanInfo
051: implements NewMidAirRefuelPG, Cloneable {
052: public MidAirRefuelPGImpl() {
053: }
054:
055: // Slots
056:
057: private Distance theDistanceToAirbase;
058:
059: public Distance getDistanceToAirbase() {
060: return theDistanceToAirbase;
061: }
062:
063: public void setDistanceToAirbase(Distance distance_to_airbase) {
064: theDistanceToAirbase = distance_to_airbase;
065: }
066:
067: private Duration theTimeToRefuel;
068:
069: public Duration getTimeToRefuel() {
070: return theTimeToRefuel;
071: }
072:
073: public void setTimeToRefuel(Duration time_to_refuel) {
074: theTimeToRefuel = time_to_refuel;
075: }
076:
077: public MidAirRefuelPGImpl(MidAirRefuelPG original) {
078: theDistanceToAirbase = original.getDistanceToAirbase();
079: theTimeToRefuel = original.getTimeToRefuel();
080: }
081:
082: public boolean equals(Object other) {
083:
084: if (!(other instanceof MidAirRefuelPG)) {
085: return false;
086: }
087:
088: MidAirRefuelPG otherMidAirRefuelPG = (MidAirRefuelPG) other;
089:
090: if (getDistanceToAirbase() == null) {
091: if (otherMidAirRefuelPG.getDistanceToAirbase() != null) {
092: return false;
093: }
094: } else if (!(getDistanceToAirbase().equals(otherMidAirRefuelPG
095: .getDistanceToAirbase()))) {
096: return false;
097: }
098:
099: if (getTimeToRefuel() == null) {
100: if (otherMidAirRefuelPG.getTimeToRefuel() != null) {
101: return false;
102: }
103: } else if (!(getTimeToRefuel().equals(otherMidAirRefuelPG
104: .getTimeToRefuel()))) {
105: return false;
106: }
107:
108: return true;
109: }
110:
111: public boolean hasDataQuality() {
112: return false;
113: }
114:
115: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
116: return null;
117: }
118:
119: // static inner extension class for real DataQuality Support
120: public final static class DQ extends MidAirRefuelPGImpl implements
121: org.cougaar.planning.ldm.dq.NewHasDataQuality {
122: public DQ() {
123: super ();
124: }
125:
126: public DQ(MidAirRefuelPG original) {
127: super (original);
128: }
129:
130: public Object clone() {
131: return new DQ(this );
132: }
133:
134: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
135:
136: public boolean hasDataQuality() {
137: return (_dq != null);
138: }
139:
140: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
141: return _dq;
142: }
143:
144: public void setDataQuality(
145: org.cougaar.planning.ldm.dq.DataQuality dq) {
146: _dq = dq;
147: }
148:
149: private void writeObject(ObjectOutputStream out)
150: throws IOException {
151: out.defaultWriteObject();
152: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
153: out.writeObject(_dq);
154: }
155:
156: private void readObject(ObjectInputStream in)
157: throws ClassNotFoundException, IOException {
158: in.defaultReadObject();
159: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
160: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
161: .readObject();
162: }
163:
164: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
165: static {
166: try {
167: properties[0] = new PropertyDescriptor("dataQuality",
168: DQ.class, "getDataQuality", null);
169: } catch (Exception e) {
170: e.printStackTrace();
171: }
172: }
173:
174: public PropertyDescriptor[] getPropertyDescriptors() {
175: PropertyDescriptor[] pds = super .properties;
176: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
177: + properties.length];
178: System.arraycopy(pds, 0, ps, 0, pds.length);
179: System.arraycopy(properties, 0, ps, pds.length,
180: properties.length);
181: return ps;
182: }
183: }
184:
185: private transient MidAirRefuelPG _locked = null;
186:
187: public PropertyGroup lock(Object key) {
188: if (_locked == null)
189: _locked = new _Locked(key);
190: return _locked;
191: }
192:
193: public PropertyGroup lock() {
194: return lock(null);
195: }
196:
197: public NewPropertyGroup unlock(Object key) {
198: return this ;
199: }
200:
201: public Object clone() throws CloneNotSupportedException {
202: return new MidAirRefuelPGImpl(MidAirRefuelPGImpl.this );
203: }
204:
205: public PropertyGroup copy() {
206: try {
207: return (PropertyGroup) clone();
208: } catch (CloneNotSupportedException cnse) {
209: return null;
210: }
211: }
212:
213: public Class getPrimaryClass() {
214: return primaryClass;
215: }
216:
217: public String getAssetGetMethod() {
218: return assetGetter;
219: }
220:
221: public String getAssetSetMethod() {
222: return assetSetter;
223: }
224:
225: private final static PropertyDescriptor properties[] = new PropertyDescriptor[2];
226: static {
227: try {
228: properties[0] = new PropertyDescriptor(
229: "distance_to_airbase", MidAirRefuelPG.class,
230: "getDistanceToAirbase", null);
231: properties[1] = new PropertyDescriptor("time_to_refuel",
232: MidAirRefuelPG.class, "getTimeToRefuel", null);
233: } catch (Exception e) {
234: org.cougaar.util.log.Logging
235: .getLogger(MidAirRefuelPG.class).error(
236: "Caught exception", e);
237: }
238: }
239:
240: public PropertyDescriptor[] getPropertyDescriptors() {
241: return properties;
242: }
243:
244: private final class _Locked extends java.beans.SimpleBeanInfo
245: implements MidAirRefuelPG, Cloneable, LockedPG {
246: private transient Object theKey = null;
247:
248: _Locked(Object key) {
249: if (this .theKey == null)
250: this .theKey = key;
251: }
252:
253: public _Locked() {
254: }
255:
256: public PropertyGroup lock() {
257: return this ;
258: }
259:
260: public PropertyGroup lock(Object o) {
261: return this ;
262: }
263:
264: public NewPropertyGroup unlock(Object key)
265: throws IllegalAccessException {
266: if (theKey.equals(key)) {
267: return MidAirRefuelPGImpl.this ;
268: } else {
269: throw new IllegalAccessException(
270: "unlock: mismatched internal and provided keys!");
271: }
272: }
273:
274: public PropertyGroup copy() {
275: try {
276: return (PropertyGroup) clone();
277: } catch (CloneNotSupportedException cnse) {
278: return null;
279: }
280: }
281:
282: public Object clone() throws CloneNotSupportedException {
283: return new MidAirRefuelPGImpl(MidAirRefuelPGImpl.this );
284: }
285:
286: public boolean equals(Object object) {
287: return MidAirRefuelPGImpl.this .equals(object);
288: }
289:
290: public Distance getDistanceToAirbase() {
291: return MidAirRefuelPGImpl.this .getDistanceToAirbase();
292: }
293:
294: public Duration getTimeToRefuel() {
295: return MidAirRefuelPGImpl.this .getTimeToRefuel();
296: }
297:
298: public final boolean hasDataQuality() {
299: return MidAirRefuelPGImpl.this .hasDataQuality();
300: }
301:
302: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
303: return MidAirRefuelPGImpl.this .getDataQuality();
304: }
305:
306: public Class getPrimaryClass() {
307: return primaryClass;
308: }
309:
310: public String getAssetGetMethod() {
311: return assetGetter;
312: }
313:
314: public String getAssetSetMethod() {
315: return assetSetter;
316: }
317:
318: public PropertyDescriptor[] getPropertyDescriptors() {
319: return properties;
320: }
321:
322: public Class getIntrospectionClass() {
323: return MidAirRefuelPGImpl.class;
324: }
325:
326: }
327:
328: }
|