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