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