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