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