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 ClusterPG.
029: * @see ClusterPG
030: * @see NewClusterPG
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 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 final class ClusterPGImpl extends java.beans.SimpleBeanInfo
045: implements NewClusterPG, Cloneable {
046: public ClusterPGImpl() {
047: }
048:
049: // Slots
050:
051: private org.cougaar.core.mts.MessageAddress theMessageAddress;
052:
053: public org.cougaar.core.mts.MessageAddress getMessageAddress() {
054: return theMessageAddress;
055: }
056:
057: public void setMessageAddress(
058: org.cougaar.core.mts.MessageAddress message_address) {
059: theMessageAddress = message_address;
060: }
061:
062: private Predictor thePredictor;
063:
064: public Predictor getPredictor() {
065: return thePredictor;
066: }
067:
068: public void setPredictor(Predictor predictor) {
069: thePredictor = predictor;
070: }
071:
072: public ClusterPGImpl(ClusterPG original) {
073: theMessageAddress = original.getMessageAddress();
074: thePredictor = original.getPredictor();
075: }
076:
077: public boolean equals(Object other) {
078:
079: if (!(other instanceof ClusterPG)) {
080: return false;
081: }
082:
083: ClusterPG otherClusterPG = (ClusterPG) other;
084:
085: if (getMessageAddress() == null) {
086: if (otherClusterPG.getMessageAddress() != null) {
087: return false;
088: }
089: } else if (!(getMessageAddress().equals(otherClusterPG
090: .getMessageAddress()))) {
091: return false;
092: }
093:
094: if (getPredictor() == null) {
095: if (otherClusterPG.getPredictor() != null) {
096: return false;
097: }
098: } else if (!(getPredictor().equals(otherClusterPG
099: .getPredictor()))) {
100: return false;
101: }
102:
103: return true;
104: }
105:
106: public final boolean hasDataQuality() {
107: return false;
108: }
109:
110: private transient ClusterPG _locked = null;
111:
112: public PropertyGroup lock(Object key) {
113: if (_locked == null)
114: _locked = new _Locked(key);
115: return _locked;
116: }
117:
118: public PropertyGroup lock() {
119: return lock(null);
120: }
121:
122: public NewPropertyGroup unlock(Object key) {
123: return this ;
124: }
125:
126: public Object clone() throws CloneNotSupportedException {
127: return new ClusterPGImpl(ClusterPGImpl.this );
128: }
129:
130: public PropertyGroup copy() {
131: try {
132: return (PropertyGroup) clone();
133: } catch (CloneNotSupportedException cnse) {
134: return null;
135: }
136: }
137:
138: public Class getPrimaryClass() {
139: return primaryClass;
140: }
141:
142: public String getAssetGetMethod() {
143: return assetGetter;
144: }
145:
146: public String getAssetSetMethod() {
147: return assetSetter;
148: }
149:
150: private final static PropertyDescriptor properties[] = new PropertyDescriptor[2];
151: static {
152: try {
153: properties[0] = new PropertyDescriptor("message_address",
154: ClusterPG.class, "getMessageAddress", null);
155: properties[1] = new PropertyDescriptor("predictor",
156: ClusterPG.class, "getPredictor", null);
157: } catch (Exception e) {
158: org.cougaar.util.log.Logging.getLogger(ClusterPG.class)
159: .error("Caught exception", e);
160: }
161: }
162:
163: public PropertyDescriptor[] getPropertyDescriptors() {
164: return properties;
165: }
166:
167: private final class _Locked extends java.beans.SimpleBeanInfo
168: implements ClusterPG, Cloneable, LockedPG {
169: private transient Object theKey = null;
170:
171: _Locked(Object key) {
172: if (this .theKey == null)
173: this .theKey = key;
174: }
175:
176: public _Locked() {
177: }
178:
179: public PropertyGroup lock() {
180: return this ;
181: }
182:
183: public PropertyGroup lock(Object o) {
184: return this ;
185: }
186:
187: public NewPropertyGroup unlock(Object key)
188: throws IllegalAccessException {
189: if (theKey.equals(key)) {
190: return ClusterPGImpl.this ;
191: } else {
192: throw new IllegalAccessException(
193: "unlock: mismatched internal and provided keys!");
194: }
195: }
196:
197: public PropertyGroup copy() {
198: try {
199: return (PropertyGroup) clone();
200: } catch (CloneNotSupportedException cnse) {
201: return null;
202: }
203: }
204:
205: public Object clone() throws CloneNotSupportedException {
206: return new ClusterPGImpl(ClusterPGImpl.this );
207: }
208:
209: public boolean equals(Object object) {
210: return ClusterPGImpl.this .equals(object);
211: }
212:
213: public org.cougaar.core.mts.MessageAddress getMessageAddress() {
214: return ClusterPGImpl.this .getMessageAddress();
215: }
216:
217: public Predictor getPredictor() {
218: return ClusterPGImpl.this .getPredictor();
219: }
220:
221: public final boolean hasDataQuality() {
222: return false;
223: }
224:
225: public Class getPrimaryClass() {
226: return primaryClass;
227: }
228:
229: public String getAssetGetMethod() {
230: return assetGetter;
231: }
232:
233: public String getAssetSetMethod() {
234: return assetSetter;
235: }
236:
237: public PropertyDescriptor[] getPropertyDescriptors() {
238: return properties;
239: }
240:
241: public Class getIntrospectionClass() {
242: return ClusterPGImpl.class;
243: }
244:
245: }
246:
247: }
|