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 RailTerminalPG.
029: * @see RailTerminalPG
030: * @see NewRailTerminalPG
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 RailTerminalPGImpl extends java.beans.SimpleBeanInfo
051: implements NewRailTerminalPG, Cloneable {
052: public RailTerminalPGImpl() {
053: }
054:
055: // Slots
056:
057: private long theRailYardCapacity;
058:
059: public long getRailYardCapacity() {
060: return theRailYardCapacity;
061: }
062:
063: public void setRailYardCapacity(long rail_yard_capacity) {
064: theRailYardCapacity = rail_yard_capacity;
065: }
066:
067: private long theNumberOfContainerCranes;
068:
069: public long getNumberOfContainerCranes() {
070: return theNumberOfContainerCranes;
071: }
072:
073: public void setNumberOfContainerCranes(
074: long number_of_container_cranes) {
075: theNumberOfContainerCranes = number_of_container_cranes;
076: }
077:
078: public RailTerminalPGImpl(RailTerminalPG original) {
079: theRailYardCapacity = original.getRailYardCapacity();
080: theNumberOfContainerCranes = original
081: .getNumberOfContainerCranes();
082: }
083:
084: public boolean equals(Object other) {
085:
086: if (!(other instanceof RailTerminalPG)) {
087: return false;
088: }
089:
090: RailTerminalPG otherRailTerminalPG = (RailTerminalPG) other;
091:
092: if (!(getRailYardCapacity() == otherRailTerminalPG
093: .getRailYardCapacity())) {
094: return false;
095: }
096:
097: if (!(getNumberOfContainerCranes() == otherRailTerminalPG
098: .getNumberOfContainerCranes())) {
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 RailTerminalPGImpl implements
115: org.cougaar.planning.ldm.dq.NewHasDataQuality {
116: public DQ() {
117: super ();
118: }
119:
120: public DQ(RailTerminalPG 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 RailTerminalPG _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 RailTerminalPGImpl(RailTerminalPGImpl.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: "rail_yard_capacity", RailTerminalPG.class,
224: "getRailYardCapacity", null);
225: properties[1] = new PropertyDescriptor(
226: "number_of_container_cranes", RailTerminalPG.class,
227: "getNumberOfContainerCranes", null);
228: } catch (Exception e) {
229: org.cougaar.util.log.Logging
230: .getLogger(RailTerminalPG.class).error(
231: "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 RailTerminalPG, 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 RailTerminalPGImpl.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 RailTerminalPGImpl(RailTerminalPGImpl.this );
279: }
280:
281: public boolean equals(Object object) {
282: return RailTerminalPGImpl.this .equals(object);
283: }
284:
285: public long getRailYardCapacity() {
286: return RailTerminalPGImpl.this .getRailYardCapacity();
287: }
288:
289: public long getNumberOfContainerCranes() {
290: return RailTerminalPGImpl.this .getNumberOfContainerCranes();
291: }
292:
293: public final boolean hasDataQuality() {
294: return RailTerminalPGImpl.this .hasDataQuality();
295: }
296:
297: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
298: return RailTerminalPGImpl.this .getDataQuality();
299: }
300:
301: public Class getPrimaryClass() {
302: return primaryClass;
303: }
304:
305: public String getAssetGetMethod() {
306: return assetGetter;
307: }
308:
309: public String getAssetSetMethod() {
310: return assetSetter;
311: }
312:
313: public PropertyDescriptor[] getPropertyDescriptors() {
314: return properties;
315: }
316:
317: public Class getIntrospectionClass() {
318: return RailTerminalPGImpl.class;
319: }
320:
321: }
322:
323: }
|