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