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