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