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