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