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