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 RoadLinkPG.
029: * @see RoadLinkPG
030: * @see NewRoadLinkPG
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 RoadLinkPGImpl extends java.beans.SimpleBeanInfo implements
051: NewRoadLinkPG, Cloneable {
052: public RoadLinkPGImpl() {
053: }
054:
055: // Slots
056:
057: private int theDirection;
058:
059: public int getDirection() {
060: return theDirection;
061: }
062:
063: public void setDirection(int direction) {
064: theDirection = direction;
065: }
066:
067: private boolean theInUrbanArea;
068:
069: public boolean getInUrbanArea() {
070: return theInUrbanArea;
071: }
072:
073: public void setInUrbanArea(boolean in_urban_area) {
074: theInUrbanArea = in_urban_area;
075: }
076:
077: private int theNumberOfLanes;
078:
079: public int getNumberOfLanes() {
080: return theNumberOfLanes;
081: }
082:
083: public void setNumberOfLanes(int number_of_lanes) {
084: theNumberOfLanes = number_of_lanes;
085: }
086:
087: private int theMaximumHeight;
088:
089: public int getMaximumHeight() {
090: return theMaximumHeight;
091: }
092:
093: public void setMaximumHeight(int maximum_height) {
094: theMaximumHeight = maximum_height;
095: }
096:
097: private int theMaximumWidth;
098:
099: public int getMaximumWidth() {
100: return theMaximumWidth;
101: }
102:
103: public void setMaximumWidth(int maximum_width) {
104: theMaximumWidth = maximum_width;
105: }
106:
107: private int theLinkID;
108:
109: public int getLinkID() {
110: return theLinkID;
111: }
112:
113: public void setLinkID(int link_ID) {
114: theLinkID = link_ID;
115: }
116:
117: private int theStateCode;
118:
119: public int getStateCode() {
120: return theStateCode;
121: }
122:
123: public void setStateCode(int state_code) {
124: theStateCode = state_code;
125: }
126:
127: private String theRoute1;
128:
129: public String getRoute1() {
130: return theRoute1;
131: }
132:
133: public void setRoute1(String route_1) {
134: theRoute1 = route_1;
135: }
136:
137: private String theRoute2;
138:
139: public String getRoute2() {
140: return theRoute2;
141: }
142:
143: public void setRoute2(String route_2) {
144: theRoute2 = route_2;
145: }
146:
147: private String theMedian;
148:
149: public String getMedian() {
150: return theMedian;
151: }
152:
153: public void setMedian(String median) {
154: theMedian = median;
155: }
156:
157: private String theAccessType;
158:
159: public String getAccessType() {
160: return theAccessType;
161: }
162:
163: public void setAccessType(String access_type) {
164: theAccessType = access_type;
165: }
166:
167: private int theTruckRoute;
168:
169: public int getTruckRoute() {
170: return theTruckRoute;
171: }
172:
173: public void setTruckRoute(int truck_route) {
174: theTruckRoute = truck_route;
175: }
176:
177: private int theFunctionalClass;
178:
179: public int getFunctionalClass() {
180: return theFunctionalClass;
181: }
182:
183: public void setFunctionalClass(int functional_class) {
184: theFunctionalClass = functional_class;
185: }
186:
187: private float theMaximumConvoySpeed;
188:
189: public float getMaximumConvoySpeed() {
190: return theMaximumConvoySpeed;
191: }
192:
193: public void setMaximumConvoySpeed(float maximum_convoy_speed) {
194: theMaximumConvoySpeed = maximum_convoy_speed;
195: }
196:
197: private float theConvoyTravelTime;
198:
199: public float getConvoyTravelTime() {
200: return theConvoyTravelTime;
201: }
202:
203: public void setConvoyTravelTime(float convoy_travel_time) {
204: theConvoyTravelTime = convoy_travel_time;
205: }
206:
207: private long theNumberOfBridgesUnderHS20;
208:
209: public long getNumberOfBridgesUnderHS20() {
210: return theNumberOfBridgesUnderHS20;
211: }
212:
213: public void setNumberOfBridgesUnderHS20(
214: long number_of_bridges_under_HS20) {
215: theNumberOfBridgesUnderHS20 = number_of_bridges_under_HS20;
216: }
217:
218: private Speed theMaxSpeed;
219:
220: public Speed getMaxSpeed() {
221: return theMaxSpeed;
222: }
223:
224: public void setMaxSpeed(Speed max_speed) {
225: theMaxSpeed = max_speed;
226: }
227:
228: private Capacity theMaxCapacity;
229:
230: public Capacity getMaxCapacity() {
231: return theMaxCapacity;
232: }
233:
234: public void setMaxCapacity(Capacity max_capacity) {
235: theMaxCapacity = max_capacity;
236: }
237:
238: private Mass theMaxWeight;
239:
240: public Mass getMaxWeight() {
241: return theMaxWeight;
242: }
243:
244: public void setMaxWeight(Mass max_weight) {
245: theMaxWeight = max_weight;
246: }
247:
248: private String theLinkName;
249:
250: public String getLinkName() {
251: return theLinkName;
252: }
253:
254: public void setLinkName(String link_name) {
255: theLinkName = link_name;
256: }
257:
258: private Distance theLinkLength;
259:
260: public Distance getLinkLength() {
261: return theLinkLength;
262: }
263:
264: public void setLinkLength(Distance link_length) {
265: theLinkLength = link_length;
266: }
267:
268: public RoadLinkPGImpl(RoadLinkPG original) {
269: theDirection = original.getDirection();
270: theInUrbanArea = original.getInUrbanArea();
271: theNumberOfLanes = original.getNumberOfLanes();
272: theMaximumHeight = original.getMaximumHeight();
273: theMaximumWidth = original.getMaximumWidth();
274: theLinkID = original.getLinkID();
275: theStateCode = original.getStateCode();
276: theRoute1 = original.getRoute1();
277: theRoute2 = original.getRoute2();
278: theMedian = original.getMedian();
279: theAccessType = original.getAccessType();
280: theTruckRoute = original.getTruckRoute();
281: theFunctionalClass = original.getFunctionalClass();
282: theMaximumConvoySpeed = original.getMaximumConvoySpeed();
283: theConvoyTravelTime = original.getConvoyTravelTime();
284: theNumberOfBridgesUnderHS20 = original
285: .getNumberOfBridgesUnderHS20();
286: theMaxSpeed = original.getMaxSpeed();
287: theMaxCapacity = original.getMaxCapacity();
288: theMaxWeight = original.getMaxWeight();
289: theLinkName = original.getLinkName();
290: theLinkLength = original.getLinkLength();
291: }
292:
293: public boolean equals(Object other) {
294:
295: if (!(other instanceof RoadLinkPG)) {
296: return false;
297: }
298:
299: RoadLinkPG otherRoadLinkPG = (RoadLinkPG) other;
300:
301: if (!(getDirection() == otherRoadLinkPG.getDirection())) {
302: return false;
303: }
304:
305: if (!(getInUrbanArea() == otherRoadLinkPG.getInUrbanArea())) {
306: return false;
307: }
308:
309: if (!(getNumberOfLanes() == otherRoadLinkPG.getNumberOfLanes())) {
310: return false;
311: }
312:
313: if (!(getMaximumHeight() == otherRoadLinkPG.getMaximumHeight())) {
314: return false;
315: }
316:
317: if (!(getMaximumWidth() == otherRoadLinkPG.getMaximumWidth())) {
318: return false;
319: }
320:
321: if (!(getLinkID() == otherRoadLinkPG.getLinkID())) {
322: return false;
323: }
324:
325: if (!(getStateCode() == otherRoadLinkPG.getStateCode())) {
326: return false;
327: }
328:
329: if (getRoute1() == null) {
330: if (otherRoadLinkPG.getRoute1() != null) {
331: return false;
332: }
333: } else if (!(getRoute1().equals(otherRoadLinkPG.getRoute1()))) {
334: return false;
335: }
336:
337: if (getRoute2() == null) {
338: if (otherRoadLinkPG.getRoute2() != null) {
339: return false;
340: }
341: } else if (!(getRoute2().equals(otherRoadLinkPG.getRoute2()))) {
342: return false;
343: }
344:
345: if (getMedian() == null) {
346: if (otherRoadLinkPG.getMedian() != null) {
347: return false;
348: }
349: } else if (!(getMedian().equals(otherRoadLinkPG.getMedian()))) {
350: return false;
351: }
352:
353: if (getAccessType() == null) {
354: if (otherRoadLinkPG.getAccessType() != null) {
355: return false;
356: }
357: } else if (!(getAccessType().equals(otherRoadLinkPG
358: .getAccessType()))) {
359: return false;
360: }
361:
362: if (!(getTruckRoute() == otherRoadLinkPG.getTruckRoute())) {
363: return false;
364: }
365:
366: if (!(getFunctionalClass() == otherRoadLinkPG
367: .getFunctionalClass())) {
368: return false;
369: }
370:
371: if (!(getMaximumConvoySpeed() == otherRoadLinkPG
372: .getMaximumConvoySpeed())) {
373: return false;
374: }
375:
376: if (!(getConvoyTravelTime() == otherRoadLinkPG
377: .getConvoyTravelTime())) {
378: return false;
379: }
380:
381: if (!(getNumberOfBridgesUnderHS20() == otherRoadLinkPG
382: .getNumberOfBridgesUnderHS20())) {
383: return false;
384: }
385:
386: if (getMaxSpeed() == null) {
387: if (otherRoadLinkPG.getMaxSpeed() != null) {
388: return false;
389: }
390: } else if (!(getMaxSpeed()
391: .equals(otherRoadLinkPG.getMaxSpeed()))) {
392: return false;
393: }
394:
395: if (getMaxCapacity() == null) {
396: if (otherRoadLinkPG.getMaxCapacity() != null) {
397: return false;
398: }
399: } else if (!(getMaxCapacity().equals(otherRoadLinkPG
400: .getMaxCapacity()))) {
401: return false;
402: }
403:
404: if (getMaxWeight() == null) {
405: if (otherRoadLinkPG.getMaxWeight() != null) {
406: return false;
407: }
408: } else if (!(getMaxWeight().equals(otherRoadLinkPG
409: .getMaxWeight()))) {
410: return false;
411: }
412:
413: if (getLinkName() == null) {
414: if (otherRoadLinkPG.getLinkName() != null) {
415: return false;
416: }
417: } else if (!(getLinkName()
418: .equals(otherRoadLinkPG.getLinkName()))) {
419: return false;
420: }
421:
422: if (getLinkLength() == null) {
423: if (otherRoadLinkPG.getLinkLength() != null) {
424: return false;
425: }
426: } else if (!(getLinkLength().equals(otherRoadLinkPG
427: .getLinkLength()))) {
428: return false;
429: }
430:
431: return true;
432: }
433:
434: public boolean hasDataQuality() {
435: return false;
436: }
437:
438: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
439: return null;
440: }
441:
442: // static inner extension class for real DataQuality Support
443: public final static class DQ extends RoadLinkPGImpl implements
444: org.cougaar.planning.ldm.dq.NewHasDataQuality {
445: public DQ() {
446: super ();
447: }
448:
449: public DQ(RoadLinkPG original) {
450: super (original);
451: }
452:
453: public Object clone() {
454: return new DQ(this );
455: }
456:
457: private transient org.cougaar.planning.ldm.dq.DataQuality _dq = null;
458:
459: public boolean hasDataQuality() {
460: return (_dq != null);
461: }
462:
463: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
464: return _dq;
465: }
466:
467: public void setDataQuality(
468: org.cougaar.planning.ldm.dq.DataQuality dq) {
469: _dq = dq;
470: }
471:
472: private void writeObject(ObjectOutputStream out)
473: throws IOException {
474: out.defaultWriteObject();
475: if (out instanceof org.cougaar.core.persist.PersistenceOutputStream)
476: out.writeObject(_dq);
477: }
478:
479: private void readObject(ObjectInputStream in)
480: throws ClassNotFoundException, IOException {
481: in.defaultReadObject();
482: if (in instanceof org.cougaar.core.persist.PersistenceInputStream)
483: _dq = (org.cougaar.planning.ldm.dq.DataQuality) in
484: .readObject();
485: }
486:
487: private final static PropertyDescriptor properties[] = new PropertyDescriptor[1];
488: static {
489: try {
490: properties[0] = new PropertyDescriptor("dataQuality",
491: DQ.class, "getDataQuality", null);
492: } catch (Exception e) {
493: e.printStackTrace();
494: }
495: }
496:
497: public PropertyDescriptor[] getPropertyDescriptors() {
498: PropertyDescriptor[] pds = super .properties;
499: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length
500: + properties.length];
501: System.arraycopy(pds, 0, ps, 0, pds.length);
502: System.arraycopy(properties, 0, ps, pds.length,
503: properties.length);
504: return ps;
505: }
506: }
507:
508: private transient RoadLinkPG _locked = null;
509:
510: public PropertyGroup lock(Object key) {
511: if (_locked == null)
512: _locked = new _Locked(key);
513: return _locked;
514: }
515:
516: public PropertyGroup lock() {
517: return lock(null);
518: }
519:
520: public NewPropertyGroup unlock(Object key) {
521: return this ;
522: }
523:
524: public Object clone() throws CloneNotSupportedException {
525: return new RoadLinkPGImpl(RoadLinkPGImpl.this );
526: }
527:
528: public PropertyGroup copy() {
529: try {
530: return (PropertyGroup) clone();
531: } catch (CloneNotSupportedException cnse) {
532: return null;
533: }
534: }
535:
536: public Class getPrimaryClass() {
537: return primaryClass;
538: }
539:
540: public String getAssetGetMethod() {
541: return assetGetter;
542: }
543:
544: public String getAssetSetMethod() {
545: return assetSetter;
546: }
547:
548: private final static PropertyDescriptor properties[] = new PropertyDescriptor[21];
549: static {
550: try {
551: properties[0] = new PropertyDescriptor("direction",
552: RoadLinkPG.class, "getDirection", null);
553: properties[1] = new PropertyDescriptor("in_urban_area",
554: RoadLinkPG.class, "getInUrbanArea", null);
555: properties[2] = new PropertyDescriptor("number_of_lanes",
556: RoadLinkPG.class, "getNumberOfLanes", null);
557: properties[3] = new PropertyDescriptor("maximum_height",
558: RoadLinkPG.class, "getMaximumHeight", null);
559: properties[4] = new PropertyDescriptor("maximum_width",
560: RoadLinkPG.class, "getMaximumWidth", null);
561: properties[5] = new PropertyDescriptor("link_ID",
562: RoadLinkPG.class, "getLinkID", null);
563: properties[6] = new PropertyDescriptor("state_code",
564: RoadLinkPG.class, "getStateCode", null);
565: properties[7] = new PropertyDescriptor("route_1",
566: RoadLinkPG.class, "getRoute1", null);
567: properties[8] = new PropertyDescriptor("route_2",
568: RoadLinkPG.class, "getRoute2", null);
569: properties[9] = new PropertyDescriptor("median",
570: RoadLinkPG.class, "getMedian", null);
571: properties[10] = new PropertyDescriptor("access_type",
572: RoadLinkPG.class, "getAccessType", null);
573: properties[11] = new PropertyDescriptor("truck_route",
574: RoadLinkPG.class, "getTruckRoute", null);
575: properties[12] = new PropertyDescriptor("functional_class",
576: RoadLinkPG.class, "getFunctionalClass", null);
577: properties[13] = new PropertyDescriptor(
578: "maximum_convoy_speed", RoadLinkPG.class,
579: "getMaximumConvoySpeed", null);
580: properties[14] = new PropertyDescriptor(
581: "convoy_travel_time", RoadLinkPG.class,
582: "getConvoyTravelTime", null);
583: properties[15] = new PropertyDescriptor(
584: "number_of_bridges_under_HS20", RoadLinkPG.class,
585: "getNumberOfBridgesUnderHS20", null);
586: properties[16] = new PropertyDescriptor("max_speed",
587: RoadLinkPG.class, "getMaxSpeed", null);
588: properties[17] = new PropertyDescriptor("max_capacity",
589: RoadLinkPG.class, "getMaxCapacity", null);
590: properties[18] = new PropertyDescriptor("max_weight",
591: RoadLinkPG.class, "getMaxWeight", null);
592: properties[19] = new PropertyDescriptor("link_name",
593: RoadLinkPG.class, "getLinkName", null);
594: properties[20] = new PropertyDescriptor("link_length",
595: RoadLinkPG.class, "getLinkLength", null);
596: } catch (Exception e) {
597: org.cougaar.util.log.Logging.getLogger(RoadLinkPG.class)
598: .error("Caught exception", e);
599: }
600: }
601:
602: public PropertyDescriptor[] getPropertyDescriptors() {
603: return properties;
604: }
605:
606: private final class _Locked extends java.beans.SimpleBeanInfo
607: implements RoadLinkPG, Cloneable, LockedPG {
608: private transient Object theKey = null;
609:
610: _Locked(Object key) {
611: if (this .theKey == null)
612: this .theKey = key;
613: }
614:
615: public _Locked() {
616: }
617:
618: public PropertyGroup lock() {
619: return this ;
620: }
621:
622: public PropertyGroup lock(Object o) {
623: return this ;
624: }
625:
626: public NewPropertyGroup unlock(Object key)
627: throws IllegalAccessException {
628: if (theKey.equals(key)) {
629: return RoadLinkPGImpl.this ;
630: } else {
631: throw new IllegalAccessException(
632: "unlock: mismatched internal and provided keys!");
633: }
634: }
635:
636: public PropertyGroup copy() {
637: try {
638: return (PropertyGroup) clone();
639: } catch (CloneNotSupportedException cnse) {
640: return null;
641: }
642: }
643:
644: public Object clone() throws CloneNotSupportedException {
645: return new RoadLinkPGImpl(RoadLinkPGImpl.this );
646: }
647:
648: public boolean equals(Object object) {
649: return RoadLinkPGImpl.this .equals(object);
650: }
651:
652: public int getDirection() {
653: return RoadLinkPGImpl.this .getDirection();
654: }
655:
656: public boolean getInUrbanArea() {
657: return RoadLinkPGImpl.this .getInUrbanArea();
658: }
659:
660: public int getNumberOfLanes() {
661: return RoadLinkPGImpl.this .getNumberOfLanes();
662: }
663:
664: public int getMaximumHeight() {
665: return RoadLinkPGImpl.this .getMaximumHeight();
666: }
667:
668: public int getMaximumWidth() {
669: return RoadLinkPGImpl.this .getMaximumWidth();
670: }
671:
672: public int getLinkID() {
673: return RoadLinkPGImpl.this .getLinkID();
674: }
675:
676: public int getStateCode() {
677: return RoadLinkPGImpl.this .getStateCode();
678: }
679:
680: public String getRoute1() {
681: return RoadLinkPGImpl.this .getRoute1();
682: }
683:
684: public String getRoute2() {
685: return RoadLinkPGImpl.this .getRoute2();
686: }
687:
688: public String getMedian() {
689: return RoadLinkPGImpl.this .getMedian();
690: }
691:
692: public String getAccessType() {
693: return RoadLinkPGImpl.this .getAccessType();
694: }
695:
696: public int getTruckRoute() {
697: return RoadLinkPGImpl.this .getTruckRoute();
698: }
699:
700: public int getFunctionalClass() {
701: return RoadLinkPGImpl.this .getFunctionalClass();
702: }
703:
704: public float getMaximumConvoySpeed() {
705: return RoadLinkPGImpl.this .getMaximumConvoySpeed();
706: }
707:
708: public float getConvoyTravelTime() {
709: return RoadLinkPGImpl.this .getConvoyTravelTime();
710: }
711:
712: public long getNumberOfBridgesUnderHS20() {
713: return RoadLinkPGImpl.this .getNumberOfBridgesUnderHS20();
714: }
715:
716: public Speed getMaxSpeed() {
717: return RoadLinkPGImpl.this .getMaxSpeed();
718: }
719:
720: public Capacity getMaxCapacity() {
721: return RoadLinkPGImpl.this .getMaxCapacity();
722: }
723:
724: public Mass getMaxWeight() {
725: return RoadLinkPGImpl.this .getMaxWeight();
726: }
727:
728: public String getLinkName() {
729: return RoadLinkPGImpl.this .getLinkName();
730: }
731:
732: public Distance getLinkLength() {
733: return RoadLinkPGImpl.this .getLinkLength();
734: }
735:
736: public final boolean hasDataQuality() {
737: return RoadLinkPGImpl.this .hasDataQuality();
738: }
739:
740: public final org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
741: return RoadLinkPGImpl.this .getDataQuality();
742: }
743:
744: public Class getPrimaryClass() {
745: return primaryClass;
746: }
747:
748: public String getAssetGetMethod() {
749: return assetGetter;
750: }
751:
752: public String getAssetSetMethod() {
753: return assetSetter;
754: }
755:
756: public PropertyDescriptor[] getPropertyDescriptors() {
757: return properties;
758: }
759:
760: public Class getIntrospectionClass() {
761: return RoadLinkPGImpl.class;
762: }
763:
764: }
765:
766: }
|