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