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