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