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