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