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