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