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