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