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