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