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