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 SeaportPG.
029: * @see SeaportPG
030: * @see NewSeaportPG
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 SeaportPGImpl extends java.beans.SimpleBeanInfo implements
051: NewSeaportPG, Cloneable {
052: public SeaportPGImpl() {
053: }
054:
055: // Slots
056:
057: private long theNumberOfROROBerths;
058:
059: public long getNumberOfROROBerths() {
060: return theNumberOfROROBerths;
061: }
062:
063: public void setNumberOfROROBerths(long number_of_RORO_berths) {
064: theNumberOfROROBerths = number_of_RORO_berths;
065: }
066:
067: private long theNumberOfContainerBerths;
068:
069: public long getNumberOfContainerBerths() {
070: return theNumberOfContainerBerths;
071: }
072:
073: public void setNumberOfContainerBerths(
074: long number_of_container_berths) {
075: theNumberOfContainerBerths = number_of_container_berths;
076: }
077:
078: private Distance thePierLength;
079:
080: public Distance getPierLength() {
081: return thePierLength;
082: }
083:
084: public void setPierLength(Distance pier_length) {
085: thePierLength = pier_length;
086: }
087:
088: private Distance thePierWidth;
089:
090: public Distance getPierWidth() {
091: return thePierWidth;
092: }
093:
094: public void setPierWidth(Distance pier_width) {
095: thePierWidth = pier_width;
096: }
097:
098: private Distance thePierDepth;
099:
100: public Distance getPierDepth() {
101: return thePierDepth;
102: }
103:
104: public void setPierDepth(Distance pier_depth) {
105: thePierDepth = pier_depth;
106: }
107:
108: private Distance theSupportedTurningRadius;
109:
110: public Distance getSupportedTurningRadius() {
111: return theSupportedTurningRadius;
112: }
113:
114: public void setSupportedTurningRadius(
115: Distance supported_turning_radius) {
116: theSupportedTurningRadius = supported_turning_radius;
117: }
118:
119: private Distance theHighTideDraft;
120:
121: public Distance getHighTideDraft() {
122: return theHighTideDraft;
123: }
124:
125: public void setHighTideDraft(Distance high_tide_draft) {
126: theHighTideDraft = high_tide_draft;
127: }
128:
129: private Distance theLowTideDraft;
130:
131: public Distance getLowTideDraft() {
132: return theLowTideDraft;
133: }
134:
135: public void setLowTideDraft(Distance low_tide_draft) {
136: theLowTideDraft = low_tide_draft;
137: }
138:
139: private long theNumberOfContainerCranes;
140:
141: public long getNumberOfContainerCranes() {
142: return theNumberOfContainerCranes;
143: }
144:
145: public void setNumberOfContainerCranes(
146: long number_of_container_cranes) {
147: theNumberOfContainerCranes = number_of_container_cranes;
148: }
149:
150: public SeaportPGImpl(SeaportPG original) {
151: theNumberOfROROBerths = original.getNumberOfROROBerths();
152: theNumberOfContainerBerths = original
153: .getNumberOfContainerBerths();
154: thePierLength = original.getPierLength();
155: thePierWidth = original.getPierWidth();
156: thePierDepth = original.getPierDepth();
157: theSupportedTurningRadius = original
158: .getSupportedTurningRadius();
159: theHighTideDraft = original.getHighTideDraft();
160: theLowTideDraft = original.getLowTideDraft();
161: theNumberOfContainerCranes = original
162: .getNumberOfContainerCranes();
163: }
164:
165: public boolean equals(Object other) {
166:
167: if (!(other instanceof SeaportPG)) {
168: return false;
169: }
170:
171: SeaportPG otherSeaportPG = (SeaportPG) other;
172:
173: if (!(getNumberOfROROBerths() == otherSeaportPG
174: .getNumberOfROROBerths())) {
175: return false;
176: }
177:
178: if (!(getNumberOfContainerBerths() == otherSeaportPG
179: .getNumberOfContainerBerths())) {
180: return false;
181: }
182:
183: if (getPierLength() == null) {
184: if (otherSeaportPG.getPierLength() != null) {
185: return false;
186: }
187: } else if (!(getPierLength().equals(otherSeaportPG
188: .getPierLength()))) {
189: return false;
190: }
191:
192: if (getPierWidth() == null) {
193: if (otherSeaportPG.getPierWidth() != null) {
194: return false;
195: }
196: } else if (!(getPierWidth().equals(otherSeaportPG
197: .getPierWidth()))) {
198: return false;
199: }
200:
201: if (getPierDepth() == null) {
202: if (otherSeaportPG.getPierDepth() != null) {
203: return false;
204: }
205: } else if (!(getPierDepth().equals(otherSeaportPG
206: .getPierDepth()))) {
207: return false;
208: }
209:
210: if (getSupportedTurningRadius() == null) {
211: if (otherSeaportPG.getSupportedTurningRadius() != null) {
212: return false;
213: }
214: } else if (!(getSupportedTurningRadius().equals(otherSeaportPG
215: .getSupportedTurningRadius()))) {
216: return false;
217: }
218:
219: if (getHighTideDraft() == null) {
220: if (otherSeaportPG.getHighTideDraft() != null) {
221: return false;
222: }
223: } else if (!(getHighTideDraft().equals(otherSeaportPG
224: .getHighTideDraft()))) {
225: return false;
226: }
227:
228: if (getLowTideDraft() == null) {
229: if (otherSeaportPG.getLowTideDraft() != null) {
230: return false;
231: }
232: } else if (!(getLowTideDraft().equals(otherSeaportPG
233: .getLowTideDraft()))) {
234: return false;
235: }
236:
237: if (!(getNumberOfContainerCranes() == otherSeaportPG
238: .getNumberOfContainerCranes())) {
239: return false;
240: }
241:
242: return true;
243: }
244:
245: public boolean hasDataQuality() {
246: return false;
247: }
248:
249: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
250: return null;
251: }
252:
253: // static inner extension class for real DataQuality Support
254: public final static class DQ extends SeaportPGImpl implements
255: org.cougaar.planning.ldm.dq.NewHasDataQuality {
256: public DQ() {
257: super ();
258: }
259:
260: public DQ(SeaportPG original) {
261: super (original);
262: }
263:
264: public Object clone() {
265: return new DQ(this );
266: }
267:
268: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
269:
270: public boolean hasDataQuality() {
271: return (_dq != null);
272: }
273:
274: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
275: return _dq;
276: }
277:
278: public void setDataQuality(
279: org.cougaar.planning.ldm.dq.DataQuality dq) {
280: _dq = dq;
281: }
282:
283: private void writeObject(ObjectOutputStream out)
284: throws IOException {
285: out.defaultWriteObject();
286: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
287: out.writeObject(_dq);
288: }
289:
290: private void readObject(ObjectInputStream in)
291: throws ClassNotFoundException, IOException {
292: in.defaultReadObject();
293: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
294: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
295: .readObject();
296: }
297:
298: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
299: static {
300: try {
301: properties[0] = new PropertyDescriptor("dataQuality",
302: DQ.class, "getDataQuality", null);
303: } catch (Exception e) {
304: e.printStackTrace();
305: }
306: }
307:
308: public PropertyDescriptor[] getPropertyDescriptors() {
309: PropertyDescriptor[] pds = super .properties;
310: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
311: + properties.length];
312: System.arraycopy(pds, 0, ps, 0, pds.length);
313: System.arraycopy(properties, 0, ps, pds.length,
314: properties.length);
315: return ps;
316: }
317: }
318:
319: private transient SeaportPG _locked = null;
320:
321: public PropertyGroup lock(Object key) {
322: if (_locked == null)
323: _locked = new _Locked(key);
324: return _locked;
325: }
326:
327: public PropertyGroup lock() {
328: return lock(null);
329: }
330:
331: public NewPropertyGroup unlock(Object key) {
332: return this ;
333: }
334:
335: public Object clone() throws CloneNotSupportedException {
336: return new SeaportPGImpl(SeaportPGImpl.this );
337: }
338:
339: public PropertyGroup copy() {
340: try {
341: return (PropertyGroup) clone();
342: } catch (CloneNotSupportedException cnse) {
343: return null;
344: }
345: }
346:
347: public Class getPrimaryClass() {
348: return primaryClass;
349: }
350:
351: public String getAssetGetMethod() {
352: return assetGetter;
353: }
354:
355: public String getAssetSetMethod() {
356: return assetSetter;
357: }
358:
359: private final static PropertyDescriptor properties[] = new PropertyDescriptor[9];
360: static {
361: try {
362: properties[0] = new PropertyDescriptor(
363: "number_of_RORO_berths", SeaportPG.class,
364: "getNumberOfROROBerths", null);
365: properties[1] = new PropertyDescriptor(
366: "number_of_container_berths", SeaportPG.class,
367: "getNumberOfContainerBerths", null);
368: properties[2] = new PropertyDescriptor("pier_length",
369: SeaportPG.class, "getPierLength", null);
370: properties[3] = new PropertyDescriptor("pier_width",
371: SeaportPG.class, "getPierWidth", null);
372: properties[4] = new PropertyDescriptor("pier_depth",
373: SeaportPG.class, "getPierDepth", null);
374: properties[5] = new PropertyDescriptor(
375: "supported_turning_radius", SeaportPG.class,
376: "getSupportedTurningRadius", null);
377: properties[6] = new PropertyDescriptor("high_tide_draft",
378: SeaportPG.class, "getHighTideDraft", null);
379: properties[7] = new PropertyDescriptor("low_tide_draft",
380: SeaportPG.class, "getLowTideDraft", null);
381: properties[8] = new PropertyDescriptor(
382: "number_of_container_cranes", SeaportPG.class,
383: "getNumberOfContainerCranes", null);
384: } catch (Exception e) {
385: org.cougaar.util.log.Logging.getLogger(SeaportPG.class)
386: .error("Caught exception", e);
387: }
388: }
389:
390: public PropertyDescriptor[] getPropertyDescriptors() {
391: return properties;
392: }
393:
394: private final class _Locked extends java.beans.SimpleBeanInfo
395: implements SeaportPG, Cloneable, LockedPG {
396: private transient Object theKey = null;
397:
398: _Locked(Object key) {
399: if (this .theKey == null)
400: this .theKey = key;
401: }
402:
403: public _Locked() {
404: }
405:
406: public PropertyGroup lock() {
407: return this ;
408: }
409:
410: public PropertyGroup lock(Object o) {
411: return this ;
412: }
413:
414: public NewPropertyGroup unlock(Object key)
415: throws IllegalAccessException {
416: if (theKey.equals(key)) {
417: return SeaportPGImpl.this ;
418: } else {
419: throw new IllegalAccessException(
420: "unlock: mismatched internal and provided keys!");
421: }
422: }
423:
424: public PropertyGroup copy() {
425: try {
426: return (PropertyGroup) clone();
427: } catch (CloneNotSupportedException cnse) {
428: return null;
429: }
430: }
431:
432: public Object clone() throws CloneNotSupportedException {
433: return new SeaportPGImpl(SeaportPGImpl.this );
434: }
435:
436: public boolean equals(Object object) {
437: return SeaportPGImpl.this .equals(object);
438: }
439:
440: public long getNumberOfROROBerths() {
441: return SeaportPGImpl.this .getNumberOfROROBerths();
442: }
443:
444: public long getNumberOfContainerBerths() {
445: return SeaportPGImpl.this .getNumberOfContainerBerths();
446: }
447:
448: public Distance getPierLength() {
449: return SeaportPGImpl.this .getPierLength();
450: }
451:
452: public Distance getPierWidth() {
453: return SeaportPGImpl.this .getPierWidth();
454: }
455:
456: public Distance getPierDepth() {
457: return SeaportPGImpl.this .getPierDepth();
458: }
459:
460: public Distance getSupportedTurningRadius() {
461: return SeaportPGImpl.this .getSupportedTurningRadius();
462: }
463:
464: public Distance getHighTideDraft() {
465: return SeaportPGImpl.this .getHighTideDraft();
466: }
467:
468: public Distance getLowTideDraft() {
469: return SeaportPGImpl.this .getLowTideDraft();
470: }
471:
472: public long getNumberOfContainerCranes() {
473: return SeaportPGImpl.this .getNumberOfContainerCranes();
474: }
475:
476: public final boolean hasDataQuality() {
477: return SeaportPGImpl.this .hasDataQuality();
478: }
479:
480: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
481: return SeaportPGImpl.this .getDataQuality();
482: }
483:
484: public Class getPrimaryClass() {
485: return primaryClass;
486: }
487:
488: public String getAssetGetMethod() {
489: return assetGetter;
490: }
491:
492: public String getAssetSetMethod() {
493: return assetSetter;
494: }
495:
496: public PropertyDescriptor[] getPropertyDescriptors() {
497: return properties;
498: }
499:
500: public Class getIntrospectionClass() {
501: return SeaportPGImpl.class;
502: }
503:
504: }
505:
506: }
|