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