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 OnRoadTransportationPG.
029: * @see OnRoadTransportationPG
030: * @see NewOnRoadTransportationPG
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 OnRoadTransportationPGImpl extends
051: java.beans.SimpleBeanInfo implements NewOnRoadTransportationPG,
052: Cloneable {
053: public OnRoadTransportationPGImpl() {
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 OnRoadTransportationPGImpl(OnRoadTransportationPG 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 OnRoadTransportationPG)) {
130: return false;
131: }
132:
133: OnRoadTransportationPG otherOnRoadTransportationPG = (OnRoadTransportationPG) other;
134:
135: if (!(getContainerCount() == otherOnRoadTransportationPG
136: .getContainerCount())) {
137: return false;
138: }
139:
140: if (getNonContainerCapacity() == null) {
141: if (otherOnRoadTransportationPG.getNonContainerCapacity() != null) {
142: return false;
143: }
144: } else if (!(getNonContainerCapacity()
145: .equals(otherOnRoadTransportationPG
146: .getNonContainerCapacity()))) {
147: return false;
148: }
149:
150: if (getWaterCapacity() == null) {
151: if (otherOnRoadTransportationPG.getWaterCapacity() != null) {
152: return false;
153: }
154: } else if (!(getWaterCapacity()
155: .equals(otherOnRoadTransportationPG.getWaterCapacity()))) {
156: return false;
157: }
158:
159: if (getPetroleumCapacity() == null) {
160: if (otherOnRoadTransportationPG.getPetroleumCapacity() != null) {
161: return false;
162: }
163: } else if (!(getPetroleumCapacity()
164: .equals(otherOnRoadTransportationPG
165: .getPetroleumCapacity()))) {
166: return false;
167: }
168:
169: if (getAmmunitionCapacity() == null) {
170: if (otherOnRoadTransportationPG.getAmmunitionCapacity() != null) {
171: return false;
172: }
173: } else if (!(getAmmunitionCapacity()
174: .equals(otherOnRoadTransportationPG
175: .getAmmunitionCapacity()))) {
176: return false;
177: }
178:
179: if (!(getPassengerCapacity() == otherOnRoadTransportationPG
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 OnRoadTransportationPGImpl
197: implements org.cougaar.planning.ldm.dq.NewHasDataQuality {
198: public DQ() {
199: super ();
200: }
201:
202: public DQ(OnRoadTransportationPG 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 OnRoadTransportationPG _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 OnRoadTransportationPGImpl(
279: OnRoadTransportationPGImpl.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: OnRoadTransportationPG.class, "getContainerCount",
307: null);
308: properties[1] = new PropertyDescriptor(
309: "non_container_capacity",
310: OnRoadTransportationPG.class,
311: "getNonContainerCapacity", null);
312: properties[2] = new PropertyDescriptor("water_capacity",
313: OnRoadTransportationPG.class, "getWaterCapacity",
314: null);
315: properties[3] = new PropertyDescriptor(
316: "petroleum_capacity", OnRoadTransportationPG.class,
317: "getPetroleumCapacity", null);
318: properties[4] = new PropertyDescriptor(
319: "ammunition_capacity",
320: OnRoadTransportationPG.class,
321: "getAmmunitionCapacity", null);
322: properties[5] = new PropertyDescriptor(
323: "passenger_capacity", OnRoadTransportationPG.class,
324: "getPassengerCapacity", null);
325: } catch (Exception e) {
326: org.cougaar.util.log.Logging.getLogger(
327: OnRoadTransportationPG.class).error(
328: "Caught exception", e);
329: }
330: }
331:
332: public PropertyDescriptor[] getPropertyDescriptors() {
333: return properties;
334: }
335:
336: private final class _Locked extends java.beans.SimpleBeanInfo
337: implements OnRoadTransportationPG, Cloneable, LockedPG {
338: private transient Object theKey = null;
339:
340: _Locked(Object key) {
341: if (this .theKey == null)
342: this .theKey = key;
343: }
344:
345: public _Locked() {
346: }
347:
348: public PropertyGroup lock() {
349: return this ;
350: }
351:
352: public PropertyGroup lock(Object o) {
353: return this ;
354: }
355:
356: public NewPropertyGroup unlock(Object key)
357: throws IllegalAccessException {
358: if (theKey.equals(key)) {
359: return OnRoadTransportationPGImpl.this ;
360: } else {
361: throw new IllegalAccessException(
362: "unlock: mismatched internal and provided keys!");
363: }
364: }
365:
366: public PropertyGroup copy() {
367: try {
368: return (PropertyGroup) clone();
369: } catch (CloneNotSupportedException cnse) {
370: return null;
371: }
372: }
373:
374: public Object clone() throws CloneNotSupportedException {
375: return new OnRoadTransportationPGImpl(
376: OnRoadTransportationPGImpl.this );
377: }
378:
379: public boolean equals(Object object) {
380: return OnRoadTransportationPGImpl.this .equals(object);
381: }
382:
383: public long getContainerCount() {
384: return OnRoadTransportationPGImpl.this .getContainerCount();
385: }
386:
387: public Volume getNonContainerCapacity() {
388: return OnRoadTransportationPGImpl.this
389: .getNonContainerCapacity();
390: }
391:
392: public Volume getWaterCapacity() {
393: return OnRoadTransportationPGImpl.this .getWaterCapacity();
394: }
395:
396: public Volume getPetroleumCapacity() {
397: return OnRoadTransportationPGImpl.this
398: .getPetroleumCapacity();
399: }
400:
401: public Mass getAmmunitionCapacity() {
402: return OnRoadTransportationPGImpl.this
403: .getAmmunitionCapacity();
404: }
405:
406: public long getPassengerCapacity() {
407: return OnRoadTransportationPGImpl.this
408: .getPassengerCapacity();
409: }
410:
411: public final boolean hasDataQuality() {
412: return OnRoadTransportationPGImpl.this .hasDataQuality();
413: }
414:
415: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
416: return OnRoadTransportationPGImpl.this .getDataQuality();
417: }
418:
419: public Class getPrimaryClass() {
420: return primaryClass;
421: }
422:
423: public String getAssetGetMethod() {
424: return assetGetter;
425: }
426:
427: public String getAssetSetMethod() {
428: return assetSetter;
429: }
430:
431: public PropertyDescriptor[] getPropertyDescriptors() {
432: return properties;
433: }
434:
435: public Class getIntrospectionClass() {
436: return OnRoadTransportationPGImpl.class;
437: }
438:
439: }
440:
441: }
|