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