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