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