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