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