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 PersonnelReadinessPG.
029: * @see PersonnelReadinessPG
030: * @see NewPersonnelReadinessPG
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 PersonnelReadinessPGImpl extends java.beans.SimpleBeanInfo
051: implements NewPersonnelReadinessPG, Cloneable {
052: public PersonnelReadinessPGImpl() {
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 PersonnelReadinessPGImpl(PersonnelReadinessPG original) {
068: theReadiness = original.getReadiness();
069: }
070:
071: public boolean equals(Object other) {
072:
073: if (!(other instanceof PersonnelReadinessPG)) {
074: return false;
075: }
076:
077: PersonnelReadinessPG otherPersonnelReadinessPG = (PersonnelReadinessPG) other;
078:
079: if (getReadiness() == null) {
080: if (otherPersonnelReadinessPG.getReadiness() != null) {
081: return false;
082: }
083: } else if (!(getReadiness().equals(otherPersonnelReadinessPG
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 PersonnelReadinessPGImpl
101: implements org.cougaar.planning.ldm.dq.NewHasDataQuality {
102: public DQ() {
103: super ();
104: }
105:
106: public DQ(PersonnelReadinessPG 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 PersonnelReadinessPG _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 PersonnelReadinessPGImpl(
183: PersonnelReadinessPGImpl.this );
184: }
185:
186: public PropertyGroup copy() {
187: try {
188: return (PropertyGroup) clone();
189: } catch (CloneNotSupportedException cnse) {
190: return null;
191: }
192: }
193:
194: public Class getPrimaryClass() {
195: return primaryClass;
196: }
197:
198: public String getAssetGetMethod() {
199: return assetGetter;
200: }
201:
202: public String getAssetSetMethod() {
203: return assetSetter;
204: }
205:
206: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
207: static {
208: try {
209: properties[0] = new PropertyDescriptor("readiness",
210: PersonnelReadinessPG.class, "getReadiness", null);
211: } catch (Exception e) {
212: org.cougaar.util.log.Logging.getLogger(
213: PersonnelReadinessPG.class).error(
214: "Caught exception", e);
215: }
216: }
217:
218: public PropertyDescriptor[] getPropertyDescriptors() {
219: return properties;
220: }
221:
222: private final class _Locked extends java.beans.SimpleBeanInfo
223: implements PersonnelReadinessPG, Cloneable, LockedPG {
224: private transient Object theKey = null;
225:
226: _Locked(Object key) {
227: if (this .theKey == null)
228: this .theKey = key;
229: }
230:
231: public _Locked() {
232: }
233:
234: public PropertyGroup lock() {
235: return this ;
236: }
237:
238: public PropertyGroup lock(Object o) {
239: return this ;
240: }
241:
242: public NewPropertyGroup unlock(Object key)
243: throws IllegalAccessException {
244: if (theKey.equals(key)) {
245: return PersonnelReadinessPGImpl.this ;
246: } else {
247: throw new IllegalAccessException(
248: "unlock: mismatched internal and provided keys!");
249: }
250: }
251:
252: public PropertyGroup copy() {
253: try {
254: return (PropertyGroup) clone();
255: } catch (CloneNotSupportedException cnse) {
256: return null;
257: }
258: }
259:
260: public Object clone() throws CloneNotSupportedException {
261: return new PersonnelReadinessPGImpl(
262: PersonnelReadinessPGImpl.this );
263: }
264:
265: public boolean equals(Object object) {
266: return PersonnelReadinessPGImpl.this .equals(object);
267: }
268:
269: public Map getReadiness() {
270: return PersonnelReadinessPGImpl.this .getReadiness();
271: }
272:
273: public final boolean hasDataQuality() {
274: return PersonnelReadinessPGImpl.this .hasDataQuality();
275: }
276:
277: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
278: return PersonnelReadinessPGImpl.this .getDataQuality();
279: }
280:
281: public Class getPrimaryClass() {
282: return primaryClass;
283: }
284:
285: public String getAssetGetMethod() {
286: return assetGetter;
287: }
288:
289: public String getAssetSetMethod() {
290: return assetSetter;
291: }
292:
293: public PropertyDescriptor[] getPropertyDescriptors() {
294: return properties;
295: }
296:
297: public Class getIntrospectionClass() {
298: return PersonnelReadinessPGImpl.class;
299: }
300:
301: }
302:
303: }
|