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