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 OffRoadTransportationPG.
029: * @see OffRoadTransportationPG
030: * @see NewOffRoadTransportationPG
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 OffRoadTransportationPGImpl extends
051: java.beans.SimpleBeanInfo implements
052: NewOffRoadTransportationPG, Cloneable {
053: public OffRoadTransportationPGImpl() {
054: }
055:
056: // Slots
057:
058: private long theContainerCount;
059:
060: public long getContainerCount() {
061: return theContainerCount;
062: }
063:
064: public void setContainerCount(long container_count) {
065: theContainerCount = container_count;
066: }
067:
068: private Volume theNonContainerCapacity;
069:
070: public Volume getNonContainerCapacity() {
071: return theNonContainerCapacity;
072: }
073:
074: public void setNonContainerCapacity(Volume non_container_capacity) {
075: theNonContainerCapacity = non_container_capacity;
076: }
077:
078: private Volume theWaterCapacity;
079:
080: public Volume getWaterCapacity() {
081: return theWaterCapacity;
082: }
083:
084: public void setWaterCapacity(Volume water_capacity) {
085: theWaterCapacity = water_capacity;
086: }
087:
088: private Volume thePetroleumCapacity;
089:
090: public Volume getPetroleumCapacity() {
091: return thePetroleumCapacity;
092: }
093:
094: public void setPetroleumCapacity(Volume petroleum_capacity) {
095: thePetroleumCapacity = petroleum_capacity;
096: }
097:
098: private Mass theAmmunitionCapacity;
099:
100: public Mass getAmmunitionCapacity() {
101: return theAmmunitionCapacity;
102: }
103:
104: public void setAmmunitionCapacity(Mass ammunition_capacity) {
105: theAmmunitionCapacity = ammunition_capacity;
106: }
107:
108: private long thePassengerCapacity;
109:
110: public long getPassengerCapacity() {
111: return thePassengerCapacity;
112: }
113:
114: public void setPassengerCapacity(long passenger_capacity) {
115: thePassengerCapacity = passenger_capacity;
116: }
117:
118: public OffRoadTransportationPGImpl(OffRoadTransportationPG original) {
119: theContainerCount = original.getContainerCount();
120: theNonContainerCapacity = original.getNonContainerCapacity();
121: theWaterCapacity = original.getWaterCapacity();
122: thePetroleumCapacity = original.getPetroleumCapacity();
123: theAmmunitionCapacity = original.getAmmunitionCapacity();
124: thePassengerCapacity = original.getPassengerCapacity();
125: }
126:
127: public boolean equals(Object other) {
128:
129: if (!(other instanceof OffRoadTransportationPG)) {
130: return false;
131: }
132:
133: OffRoadTransportationPG otherOffRoadTransportationPG = (OffRoadTransportationPG) other;
134:
135: if (!(getContainerCount() == otherOffRoadTransportationPG
136: .getContainerCount())) {
137: return false;
138: }
139:
140: if (getNonContainerCapacity() == null) {
141: if (otherOffRoadTransportationPG.getNonContainerCapacity() != null) {
142: return false;
143: }
144: } else if (!(getNonContainerCapacity()
145: .equals(otherOffRoadTransportationPG
146: .getNonContainerCapacity()))) {
147: return false;
148: }
149:
150: if (getWaterCapacity() == null) {
151: if (otherOffRoadTransportationPG.getWaterCapacity() != null) {
152: return false;
153: }
154: } else if (!(getWaterCapacity()
155: .equals(otherOffRoadTransportationPG.getWaterCapacity()))) {
156: return false;
157: }
158:
159: if (getPetroleumCapacity() == null) {
160: if (otherOffRoadTransportationPG.getPetroleumCapacity() != null) {
161: return false;
162: }
163: } else if (!(getPetroleumCapacity()
164: .equals(otherOffRoadTransportationPG
165: .getPetroleumCapacity()))) {
166: return false;
167: }
168:
169: if (getAmmunitionCapacity() == null) {
170: if (otherOffRoadTransportationPG.getAmmunitionCapacity() != null) {
171: return false;
172: }
173: } else if (!(getAmmunitionCapacity()
174: .equals(otherOffRoadTransportationPG
175: .getAmmunitionCapacity()))) {
176: return false;
177: }
178:
179: if (!(getPassengerCapacity() == otherOffRoadTransportationPG
180: .getPassengerCapacity())) {
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 OffRoadTransportationPGImpl
197: implements org.cougaar.planning.ldm.dq.NewHasDataQuality {
198: public DQ() {
199: super ();
200: }
201:
202: public DQ(OffRoadTransportationPG 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 OffRoadTransportationPG _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 OffRoadTransportationPGImpl(
279: OffRoadTransportationPGImpl.this );
280: }
281:
282: public PropertyGroup copy() {
283: try {
284: return (PropertyGroup) clone();
285: } catch (CloneNotSupportedException cnse) {
286: return null;
287: }
288: }
289:
290: public Class getPrimaryClass() {
291: return primaryClass;
292: }
293:
294: public String getAssetGetMethod() {
295: return assetGetter;
296: }
297:
298: public String getAssetSetMethod() {
299: return assetSetter;
300: }
301:
302: private final static PropertyDescriptor properties[] = new PropertyDescriptor[6];
303: static {
304: try {
305: properties[0] = new PropertyDescriptor("container_count",
306: OffRoadTransportationPG.class, "getContainerCount",
307: null);
308: properties[1] = new PropertyDescriptor(
309: "non_container_capacity",
310: OffRoadTransportationPG.class,
311: "getNonContainerCapacity", null);
312: properties[2] = new PropertyDescriptor("water_capacity",
313: OffRoadTransportationPG.class, "getWaterCapacity",
314: null);
315: properties[3] = new PropertyDescriptor(
316: "petroleum_capacity",
317: OffRoadTransportationPG.class,
318: "getPetroleumCapacity", null);
319: properties[4] = new PropertyDescriptor(
320: "ammunition_capacity",
321: OffRoadTransportationPG.class,
322: "getAmmunitionCapacity", null);
323: properties[5] = new PropertyDescriptor(
324: "passenger_capacity",
325: OffRoadTransportationPG.class,
326: "getPassengerCapacity", null);
327: } catch (Exception e) {
328: org.cougaar.util.log.Logging.getLogger(
329: OffRoadTransportationPG.class).error(
330: "Caught exception", e);
331: }
332: }
333:
334: public PropertyDescriptor[] getPropertyDescriptors() {
335: return properties;
336: }
337:
338: private final class _Locked extends java.beans.SimpleBeanInfo
339: implements OffRoadTransportationPG, Cloneable, LockedPG {
340: private transient Object theKey = null;
341:
342: _Locked(Object key) {
343: if (this .theKey == null)
344: this .theKey = key;
345: }
346:
347: public _Locked() {
348: }
349:
350: public PropertyGroup lock() {
351: return this ;
352: }
353:
354: public PropertyGroup lock(Object o) {
355: return this ;
356: }
357:
358: public NewPropertyGroup unlock(Object key)
359: throws IllegalAccessException {
360: if (theKey.equals(key)) {
361: return OffRoadTransportationPGImpl.this ;
362: } else {
363: throw new IllegalAccessException(
364: "unlock: mismatched internal and provided keys!");
365: }
366: }
367:
368: public PropertyGroup copy() {
369: try {
370: return (PropertyGroup) clone();
371: } catch (CloneNotSupportedException cnse) {
372: return null;
373: }
374: }
375:
376: public Object clone() throws CloneNotSupportedException {
377: return new OffRoadTransportationPGImpl(
378: OffRoadTransportationPGImpl.this );
379: }
380:
381: public boolean equals(Object object) {
382: return OffRoadTransportationPGImpl.this .equals(object);
383: }
384:
385: public long getContainerCount() {
386: return OffRoadTransportationPGImpl.this .getContainerCount();
387: }
388:
389: public Volume getNonContainerCapacity() {
390: return OffRoadTransportationPGImpl.this
391: .getNonContainerCapacity();
392: }
393:
394: public Volume getWaterCapacity() {
395: return OffRoadTransportationPGImpl.this .getWaterCapacity();
396: }
397:
398: public Volume getPetroleumCapacity() {
399: return OffRoadTransportationPGImpl.this
400: .getPetroleumCapacity();
401: }
402:
403: public Mass getAmmunitionCapacity() {
404: return OffRoadTransportationPGImpl.this
405: .getAmmunitionCapacity();
406: }
407:
408: public long getPassengerCapacity() {
409: return OffRoadTransportationPGImpl.this
410: .getPassengerCapacity();
411: }
412:
413: public final boolean hasDataQuality() {
414: return OffRoadTransportationPGImpl.this .hasDataQuality();
415: }
416:
417: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
418: return OffRoadTransportationPGImpl.this .getDataQuality();
419: }
420:
421: public Class getPrimaryClass() {
422: return primaryClass;
423: }
424:
425: public String getAssetGetMethod() {
426: return assetGetter;
427: }
428:
429: public String getAssetSetMethod() {
430: return assetSetter;
431: }
432:
433: public PropertyDescriptor[] getPropertyDescriptors() {
434: return properties;
435: }
436:
437: public Class getIntrospectionClass() {
438: return OffRoadTransportationPGImpl.class;
439: }
440:
441: }
442:
443: }
|