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