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