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