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