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