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 SupplyDepotPG.
029: * @see SupplyDepotPG
030: * @see NewSupplyDepotPG
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 SupplyDepotPGImpl extends java.beans.SimpleBeanInfo
051: implements NewSupplyDepotPG, Cloneable {
052: public SupplyDepotPGImpl() {
053: }
054:
055: // Slots
056:
057: private double theMaximumSupplyRate;
058:
059: public double getMaximumSupplyRate() {
060: return theMaximumSupplyRate;
061: }
062:
063: public void setMaximumSupplyRate(double maximum_supply_rate) {
064: theMaximumSupplyRate = maximum_supply_rate;
065: }
066:
067: private Volume theMaximumStorageVolume;
068:
069: public Volume getMaximumStorageVolume() {
070: return theMaximumStorageVolume;
071: }
072:
073: public void setMaximumStorageVolume(Volume maximum_storage_volume) {
074: theMaximumStorageVolume = maximum_storage_volume;
075: }
076:
077: private Area theMaximumStorageArea;
078:
079: public Area getMaximumStorageArea() {
080: return theMaximumStorageArea;
081: }
082:
083: public void setMaximumStorageArea(Area maximum_storage_area) {
084: theMaximumStorageArea = maximum_storage_area;
085: }
086:
087: public SupplyDepotPGImpl(SupplyDepotPG original) {
088: theMaximumSupplyRate = original.getMaximumSupplyRate();
089: theMaximumStorageVolume = original.getMaximumStorageVolume();
090: theMaximumStorageArea = original.getMaximumStorageArea();
091: }
092:
093: public boolean equals(Object other) {
094:
095: if (!(other instanceof SupplyDepotPG)) {
096: return false;
097: }
098:
099: SupplyDepotPG otherSupplyDepotPG = (SupplyDepotPG) other;
100:
101: if (!(getMaximumSupplyRate() == otherSupplyDepotPG
102: .getMaximumSupplyRate())) {
103: return false;
104: }
105:
106: if (getMaximumStorageVolume() == null) {
107: if (otherSupplyDepotPG.getMaximumStorageVolume() != null) {
108: return false;
109: }
110: } else if (!(getMaximumStorageVolume()
111: .equals(otherSupplyDepotPG.getMaximumStorageVolume()))) {
112: return false;
113: }
114:
115: if (getMaximumStorageArea() == null) {
116: if (otherSupplyDepotPG.getMaximumStorageArea() != null) {
117: return false;
118: }
119: } else if (!(getMaximumStorageArea().equals(otherSupplyDepotPG
120: .getMaximumStorageArea()))) {
121: return false;
122: }
123:
124: return true;
125: }
126:
127: public boolean hasDataQuality() {
128: return false;
129: }
130:
131: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
132: return null;
133: }
134:
135: // static inner extension class for real DataQuality Support
136: public final static class DQ extends SupplyDepotPGImpl implements
137: org.cougaar.planning.ldm.dq.NewHasDataQuality {
138: public DQ() {
139: super ();
140: }
141:
142: public DQ(SupplyDepotPG original) {
143: super (original);
144: }
145:
146: public Object clone() {
147: return new DQ(this );
148: }
149:
150: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
151:
152: public boolean hasDataQuality() {
153: return (_dq != null);
154: }
155:
156: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
157: return _dq;
158: }
159:
160: public void setDataQuality(
161: org.cougaar.planning.ldm.dq.DataQuality dq) {
162: _dq = dq;
163: }
164:
165: private void writeObject(ObjectOutputStream out)
166: throws IOException {
167: out.defaultWriteObject();
168: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
169: out.writeObject(_dq);
170: }
171:
172: private void readObject(ObjectInputStream in)
173: throws ClassNotFoundException, IOException {
174: in.defaultReadObject();
175: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
176: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
177: .readObject();
178: }
179:
180: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
181: static {
182: try {
183: properties[0] = new PropertyDescriptor("dataQuality",
184: DQ.class, "getDataQuality", null);
185: } catch (Exception e) {
186: e.printStackTrace();
187: }
188: }
189:
190: public PropertyDescriptor[] getPropertyDescriptors() {
191: PropertyDescriptor[] pds = super .properties;
192: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
193: + properties.length];
194: System.arraycopy(pds, 0, ps, 0, pds.length);
195: System.arraycopy(properties, 0, ps, pds.length,
196: properties.length);
197: return ps;
198: }
199: }
200:
201: private transient SupplyDepotPG _locked = null;
202:
203: public PropertyGroup lock(Object key) {
204: if (_locked == null)
205: _locked = new _Locked(key);
206: return _locked;
207: }
208:
209: public PropertyGroup lock() {
210: return lock(null);
211: }
212:
213: public NewPropertyGroup unlock(Object key) {
214: return this ;
215: }
216:
217: public Object clone() throws CloneNotSupportedException {
218: return new SupplyDepotPGImpl(SupplyDepotPGImpl.this );
219: }
220:
221: public PropertyGroup copy() {
222: try {
223: return (PropertyGroup) clone();
224: } catch (CloneNotSupportedException cnse) {
225: return null;
226: }
227: }
228:
229: public Class getPrimaryClass() {
230: return primaryClass;
231: }
232:
233: public String getAssetGetMethod() {
234: return assetGetter;
235: }
236:
237: public String getAssetSetMethod() {
238: return assetSetter;
239: }
240:
241: private final static PropertyDescriptor properties[] = new PropertyDescriptor[3];
242: static {
243: try {
244: properties[0] = new PropertyDescriptor(
245: "maximum_supply_rate", SupplyDepotPG.class,
246: "getMaximumSupplyRate", null);
247: properties[1] = new PropertyDescriptor(
248: "maximum_storage_volume", SupplyDepotPG.class,
249: "getMaximumStorageVolume", null);
250: properties[2] = new PropertyDescriptor(
251: "maximum_storage_area", SupplyDepotPG.class,
252: "getMaximumStorageArea", null);
253: } catch (Exception e) {
254: org.cougaar.util.log.Logging.getLogger(SupplyDepotPG.class)
255: .error("Caught exception", e);
256: }
257: }
258:
259: public PropertyDescriptor[] getPropertyDescriptors() {
260: return properties;
261: }
262:
263: private final class _Locked extends java.beans.SimpleBeanInfo
264: implements SupplyDepotPG, Cloneable, LockedPG {
265: private transient Object theKey = null;
266:
267: _Locked(Object key) {
268: if (this .theKey == null)
269: this .theKey = key;
270: }
271:
272: public _Locked() {
273: }
274:
275: public PropertyGroup lock() {
276: return this ;
277: }
278:
279: public PropertyGroup lock(Object o) {
280: return this ;
281: }
282:
283: public NewPropertyGroup unlock(Object key)
284: throws IllegalAccessException {
285: if (theKey.equals(key)) {
286: return SupplyDepotPGImpl.this ;
287: } else {
288: throw new IllegalAccessException(
289: "unlock: mismatched internal and provided keys!");
290: }
291: }
292:
293: public PropertyGroup copy() {
294: try {
295: return (PropertyGroup) clone();
296: } catch (CloneNotSupportedException cnse) {
297: return null;
298: }
299: }
300:
301: public Object clone() throws CloneNotSupportedException {
302: return new SupplyDepotPGImpl(SupplyDepotPGImpl.this );
303: }
304:
305: public boolean equals(Object object) {
306: return SupplyDepotPGImpl.this .equals(object);
307: }
308:
309: public double getMaximumSupplyRate() {
310: return SupplyDepotPGImpl.this .getMaximumSupplyRate();
311: }
312:
313: public Volume getMaximumStorageVolume() {
314: return SupplyDepotPGImpl.this .getMaximumStorageVolume();
315: }
316:
317: public Area getMaximumStorageArea() {
318: return SupplyDepotPGImpl.this .getMaximumStorageArea();
319: }
320:
321: public final boolean hasDataQuality() {
322: return SupplyDepotPGImpl.this .hasDataQuality();
323: }
324:
325: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
326: return SupplyDepotPGImpl.this .getDataQuality();
327: }
328:
329: public Class getPrimaryClass() {
330: return primaryClass;
331: }
332:
333: public String getAssetGetMethod() {
334: return assetGetter;
335: }
336:
337: public String getAssetSetMethod() {
338: return assetSetter;
339: }
340:
341: public PropertyDescriptor[] getPropertyDescriptors() {
342: return properties;
343: }
344:
345: public Class getIntrospectionClass() {
346: return SupplyDepotPGImpl.class;
347: }
348:
349: }
350:
351: }
|