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