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 LiquidSupplyPG.
029: * @see LiquidSupplyPG
030: * @see NewLiquidSupplyPG
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 LiquidSupplyPGImpl extends java.beans.SimpleBeanInfo
051: implements NewLiquidSupplyPG, Cloneable {
052: public LiquidSupplyPGImpl() {
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 LiquidSupplyPGImpl(LiquidSupplyPG 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 LiquidSupplyPG)) {
109: return false;
110: }
111:
112: LiquidSupplyPG otherLiquidSupplyPG = (LiquidSupplyPG) other;
113:
114: if (getStoreVolumePerDay() == null) {
115: if (otherLiquidSupplyPG.getStoreVolumePerDay() != null) {
116: return false;
117: }
118: } else if (!(getStoreVolumePerDay().equals(otherLiquidSupplyPG
119: .getStoreVolumePerDay()))) {
120: return false;
121: }
122:
123: if (getDistributeVolumePerDay() == null) {
124: if (otherLiquidSupplyPG.getDistributeVolumePerDay() != null) {
125: return false;
126: }
127: } else if (!(getDistributeVolumePerDay()
128: .equals(otherLiquidSupplyPG.getDistributeVolumePerDay()))) {
129: return false;
130: }
131:
132: if (getIssueVolumePerDay() == null) {
133: if (otherLiquidSupplyPG.getIssueVolumePerDay() != null) {
134: return false;
135: }
136: } else if (!(getIssueVolumePerDay().equals(otherLiquidSupplyPG
137: .getIssueVolumePerDay()))) {
138: return false;
139: }
140:
141: if (getPumpVolumePerMinute() == null) {
142: if (otherLiquidSupplyPG.getPumpVolumePerMinute() != null) {
143: return false;
144: }
145: } else if (!(getPumpVolumePerMinute()
146: .equals(otherLiquidSupplyPG.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 LiquidSupplyPGImpl implements
163: org.cougaar.planning.ldm.dq.NewHasDataQuality {
164: public DQ() {
165: super ();
166: }
167:
168: public DQ(LiquidSupplyPG 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 LiquidSupplyPG _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 LiquidSupplyPGImpl(LiquidSupplyPGImpl.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", LiquidSupplyPG.class,
272: "getStoreVolumePerDay", null);
273: properties[1] = new PropertyDescriptor(
274: "distribute_volume_per_day", LiquidSupplyPG.class,
275: "getDistributeVolumePerDay", null);
276: properties[2] = new PropertyDescriptor(
277: "issue_volume_per_day", LiquidSupplyPG.class,
278: "getIssueVolumePerDay", null);
279: properties[3] = new PropertyDescriptor(
280: "pump_volume_per_minute", LiquidSupplyPG.class,
281: "getPumpVolumePerMinute", null);
282: } catch (Exception e) {
283: org.cougaar.util.log.Logging
284: .getLogger(LiquidSupplyPG.class).error(
285: "Caught exception", e);
286: }
287: }
288:
289: public PropertyDescriptor[] getPropertyDescriptors() {
290: return properties;
291: }
292:
293: private final class _Locked extends java.beans.SimpleBeanInfo
294: implements LiquidSupplyPG, Cloneable, LockedPG {
295: private transient Object theKey = null;
296:
297: _Locked(Object key) {
298: if (this .theKey == null)
299: this .theKey = key;
300: }
301:
302: public _Locked() {
303: }
304:
305: public PropertyGroup lock() {
306: return this ;
307: }
308:
309: public PropertyGroup lock(Object o) {
310: return this ;
311: }
312:
313: public NewPropertyGroup unlock(Object key)
314: throws IllegalAccessException {
315: if (theKey.equals(key)) {
316: return LiquidSupplyPGImpl.this ;
317: } else {
318: throw new IllegalAccessException(
319: "unlock: mismatched internal and provided keys!");
320: }
321: }
322:
323: public PropertyGroup copy() {
324: try {
325: return (PropertyGroup) clone();
326: } catch (CloneNotSupportedException cnse) {
327: return null;
328: }
329: }
330:
331: public Object clone() throws CloneNotSupportedException {
332: return new LiquidSupplyPGImpl(LiquidSupplyPGImpl.this );
333: }
334:
335: public boolean equals(Object object) {
336: return LiquidSupplyPGImpl.this .equals(object);
337: }
338:
339: public Volume getStoreVolumePerDay() {
340: return LiquidSupplyPGImpl.this .getStoreVolumePerDay();
341: }
342:
343: public Volume getDistributeVolumePerDay() {
344: return LiquidSupplyPGImpl.this .getDistributeVolumePerDay();
345: }
346:
347: public Volume getIssueVolumePerDay() {
348: return LiquidSupplyPGImpl.this .getIssueVolumePerDay();
349: }
350:
351: public Volume getPumpVolumePerMinute() {
352: return LiquidSupplyPGImpl.this .getPumpVolumePerMinute();
353: }
354:
355: public final boolean hasDataQuality() {
356: return LiquidSupplyPGImpl.this .hasDataQuality();
357: }
358:
359: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
360: return LiquidSupplyPGImpl.this .getDataQuality();
361: }
362:
363: public Class getPrimaryClass() {
364: return primaryClass;
365: }
366:
367: public String getAssetGetMethod() {
368: return assetGetter;
369: }
370:
371: public String getAssetSetMethod() {
372: return assetSetter;
373: }
374:
375: public PropertyDescriptor[] getPropertyDescriptors() {
376: return properties;
377: }
378:
379: public Class getIntrospectionClass() {
380: return LiquidSupplyPGImpl.class;
381: }
382:
383: }
384:
385: }
|