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 RationPG.
029: * @see RationPG
030: * @see NewRationPG
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 RationPGImpl extends java.beans.SimpleBeanInfo implements
049: NewRationPG, Cloneable {
050: public RationPGImpl() {
051: }
052:
053: // Slots
054:
055: private String theMealType;
056:
057: public String getMealType() {
058: return theMealType;
059: }
060:
061: public void setMealType(String MealType) {
062: theMealType = MealType;
063: }
064:
065: private String theRationType;
066:
067: public String getRationType() {
068: return theRationType;
069: }
070:
071: public void setRationType(String RationType) {
072: theRationType = RationType;
073: }
074:
075: private String theUnitOfPack;
076:
077: public String getUnitOfPack() {
078: return theUnitOfPack;
079: }
080:
081: public void setUnitOfPack(String UnitOfPack) {
082: theUnitOfPack = UnitOfPack;
083: }
084:
085: private HashMap theMandatorySupplement;
086:
087: public HashMap getMandatorySupplement() {
088: return theMandatorySupplement;
089: }
090:
091: public void setMandatorySupplement(HashMap MandatorySupplement) {
092: theMandatorySupplement = MandatorySupplement;
093: }
094:
095: public RationPGImpl(RationPG original) {
096: theMealType = original.getMealType();
097: theRationType = original.getRationType();
098: theUnitOfPack = original.getUnitOfPack();
099: theMandatorySupplement = original.getMandatorySupplement();
100: }
101:
102: public boolean equals(Object other) {
103:
104: if (!(other instanceof RationPG)) {
105: return false;
106: }
107:
108: RationPG otherRationPG = (RationPG) other;
109:
110: if (getMealType() == null) {
111: if (otherRationPG.getMealType() != null) {
112: return false;
113: }
114: } else if (!(getMealType().equals(otherRationPG.getMealType()))) {
115: return false;
116: }
117:
118: if (getRationType() == null) {
119: if (otherRationPG.getRationType() != null) {
120: return false;
121: }
122: } else if (!(getRationType().equals(otherRationPG
123: .getRationType()))) {
124: return false;
125: }
126:
127: if (getUnitOfPack() == null) {
128: if (otherRationPG.getUnitOfPack() != null) {
129: return false;
130: }
131: } else if (!(getUnitOfPack().equals(otherRationPG
132: .getUnitOfPack()))) {
133: return false;
134: }
135:
136: if (getMandatorySupplement() == null) {
137: if (otherRationPG.getMandatorySupplement() != null) {
138: return false;
139: }
140: } else if (!(getMandatorySupplement().equals(otherRationPG
141: .getMandatorySupplement()))) {
142: return false;
143: }
144:
145: return true;
146: }
147:
148: public boolean hasDataQuality() {
149: return false;
150: }
151:
152: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
153: return null;
154: }
155:
156: // static inner extension class for real DataQuality Support
157: public final static class DQ extends RationPGImpl implements
158: org.cougaar.planning.ldm.dq.NewHasDataQuality {
159: public DQ() {
160: super ();
161: }
162:
163: public DQ(RationPG original) {
164: super (original);
165: }
166:
167: public Object clone() {
168: return new DQ(this );
169: }
170:
171: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
172:
173: public boolean hasDataQuality() {
174: return (_dq != null);
175: }
176:
177: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
178: return _dq;
179: }
180:
181: public void setDataQuality(
182: org.cougaar.planning.ldm.dq.DataQuality dq) {
183: _dq = dq;
184: }
185:
186: private void writeObject(ObjectOutputStream out)
187: throws IOException {
188: out.defaultWriteObject();
189: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
190: out.writeObject(_dq);
191: }
192:
193: private void readObject(ObjectInputStream in)
194: throws ClassNotFoundException, IOException {
195: in.defaultReadObject();
196: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
197: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
198: .readObject();
199: }
200:
201: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
202: static {
203: try {
204: properties[0] = new PropertyDescriptor("dataQuality",
205: DQ.class, "getDataQuality", null);
206: } catch (Exception e) {
207: e.printStackTrace();
208: }
209: }
210:
211: public PropertyDescriptor[] getPropertyDescriptors() {
212: PropertyDescriptor[] pds = super .properties;
213: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
214: + properties.length];
215: System.arraycopy(pds, 0, ps, 0, pds.length);
216: System.arraycopy(properties, 0, ps, pds.length,
217: properties.length);
218: return ps;
219: }
220: }
221:
222: private transient RationPG _locked = null;
223:
224: public PropertyGroup lock(Object key) {
225: if (_locked == null)
226: _locked = new _Locked(key);
227: return _locked;
228: }
229:
230: public PropertyGroup lock() {
231: return lock(null);
232: }
233:
234: public NewPropertyGroup unlock(Object key) {
235: return this ;
236: }
237:
238: public Object clone() throws CloneNotSupportedException {
239: return new RationPGImpl(RationPGImpl.this );
240: }
241:
242: public PropertyGroup copy() {
243: try {
244: return (PropertyGroup) clone();
245: } catch (CloneNotSupportedException cnse) {
246: return null;
247: }
248: }
249:
250: public Class getPrimaryClass() {
251: return primaryClass;
252: }
253:
254: public String getAssetGetMethod() {
255: return assetGetter;
256: }
257:
258: public String getAssetSetMethod() {
259: return assetSetter;
260: }
261:
262: private final static PropertyDescriptor properties[] = new PropertyDescriptor[4];
263: static {
264: try {
265: properties[0] = new PropertyDescriptor("MealType",
266: RationPG.class, "getMealType", null);
267: properties[1] = new PropertyDescriptor("RationType",
268: RationPG.class, "getRationType", null);
269: properties[2] = new PropertyDescriptor("UnitOfPack",
270: RationPG.class, "getUnitOfPack", null);
271: properties[3] = new PropertyDescriptor(
272: "MandatorySupplement", RationPG.class,
273: "getMandatorySupplement", null);
274: } catch (Exception e) {
275: org.cougaar.util.log.Logging.getLogger(RationPG.class)
276: .error("Caught exception", e);
277: }
278: }
279:
280: public PropertyDescriptor[] getPropertyDescriptors() {
281: return properties;
282: }
283:
284: private final class _Locked extends java.beans.SimpleBeanInfo
285: implements RationPG, Cloneable, LockedPG {
286: private transient Object theKey = null;
287:
288: _Locked(Object key) {
289: if (this .theKey == null)
290: this .theKey = key;
291: }
292:
293: public _Locked() {
294: }
295:
296: public PropertyGroup lock() {
297: return this ;
298: }
299:
300: public PropertyGroup lock(Object o) {
301: return this ;
302: }
303:
304: public NewPropertyGroup unlock(Object key)
305: throws IllegalAccessException {
306: if (theKey.equals(key)) {
307: return RationPGImpl.this ;
308: } else {
309: throw new IllegalAccessException(
310: "unlock: mismatched internal and provided keys!");
311: }
312: }
313:
314: public PropertyGroup copy() {
315: try {
316: return (PropertyGroup) clone();
317: } catch (CloneNotSupportedException cnse) {
318: return null;
319: }
320: }
321:
322: public Object clone() throws CloneNotSupportedException {
323: return new RationPGImpl(RationPGImpl.this );
324: }
325:
326: public boolean equals(Object object) {
327: return RationPGImpl.this .equals(object);
328: }
329:
330: public String getMealType() {
331: return RationPGImpl.this .getMealType();
332: }
333:
334: public String getRationType() {
335: return RationPGImpl.this .getRationType();
336: }
337:
338: public String getUnitOfPack() {
339: return RationPGImpl.this .getUnitOfPack();
340: }
341:
342: public HashMap getMandatorySupplement() {
343: return RationPGImpl.this .getMandatorySupplement();
344: }
345:
346: public final boolean hasDataQuality() {
347: return RationPGImpl.this .hasDataQuality();
348: }
349:
350: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
351: return RationPGImpl.this .getDataQuality();
352: }
353:
354: public Class getPrimaryClass() {
355: return primaryClass;
356: }
357:
358: public String getAssetGetMethod() {
359: return assetGetter;
360: }
361:
362: public String getAssetSetMethod() {
363: return assetSetter;
364: }
365:
366: public PropertyDescriptor[] getPropertyDescriptors() {
367: return properties;
368: }
369:
370: public Class getIntrospectionClass() {
371: return RationPGImpl.class;
372: }
373:
374: }
375:
376: }
|