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