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