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