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:46 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/glm/src/org/cougaar/glm/ldm/asset/alpassets.def - DO NOT HAND EDIT */
028: package org.cougaar.glm.ldm.asset;
029:
030: import org.cougaar.planning.ldm.asset.*;
031: import java.io.ObjectOutputStream;
032: import java.io.ObjectInputStream;
033: import java.io.IOException;
034: import java.util.Vector;
035: import java.beans.PropertyDescriptor;
036: import java.beans.IndexedPropertyDescriptor;
037: import java.beans.IntrospectionException;
038:
039: public class ClassIIClothingAndEquipment extends PhysicalAsset {
040:
041: public ClassIIClothingAndEquipment() {
042: myPackagePG = null;
043: }
044:
045: public ClassIIClothingAndEquipment(
046: ClassIIClothingAndEquipment prototype) {
047: super (prototype);
048: myPackagePG = null;
049: }
050:
051: /** For infrastructure only - use org.cougaar.core.domain.Factory.copyInstance instead. **/
052: public Object clone() throws CloneNotSupportedException {
053: ClassIIClothingAndEquipment _thing = (ClassIIClothingAndEquipment) super
054: .clone();
055: if (myPackagePG != null)
056: _thing.setPackagePG(myPackagePG.lock());
057: return _thing;
058: }
059:
060: /** create an instance of the right class for copy operations **/
061: public Asset instanceForCopy() {
062: return new ClassIIClothingAndEquipment();
063: }
064:
065: /** create an instance of this prototype **/
066: public Asset createInstance() {
067: return new ClassIIClothingAndEquipment(this );
068: }
069:
070: protected void fillAllPropertyGroups(Vector v) {
071: super .fillAllPropertyGroups(v);
072: {
073: Object _tmp = getPackagePG();
074: if (_tmp != null && !(_tmp instanceof Null_PG)) {
075: v.addElement(_tmp);
076: }
077: }
078: }
079:
080: private transient PackagePG myPackagePG;
081:
082: public PackagePG getPackagePG() {
083: PackagePG _tmp = (myPackagePG != null) ? myPackagePG
084: : (PackagePG) resolvePG(PackagePG.class);
085: return (_tmp == PackagePG.nullPG) ? null : _tmp;
086: }
087:
088: public void setPackagePG(PropertyGroup arg_PackagePG) {
089: if (!(arg_PackagePG instanceof PackagePG))
090: throw new IllegalArgumentException(
091: "setPackagePG requires a PackagePG argument.");
092: myPackagePG = (PackagePG) arg_PackagePG;
093: }
094:
095: // generic search methods
096: public PropertyGroup getLocalPG(Class c, long t) {
097: if (PackagePG.class.equals(c)) {
098: return (myPackagePG == PackagePG.nullPG) ? null
099: : myPackagePG;
100: }
101: return super .getLocalPG(c, t);
102: }
103:
104: public PropertyGroupSchedule getLocalPGSchedule(Class c) {
105: return super .getLocalPGSchedule(c);
106: }
107:
108: public void setLocalPG(Class c, PropertyGroup pg) {
109: if (PackagePG.class.equals(c)) {
110: myPackagePG = (PackagePG) pg;
111: } else
112: super .setLocalPG(c, pg);
113: }
114:
115: public void setLocalPGSchedule(PropertyGroupSchedule pgSchedule) {
116: super .setLocalPGSchedule(pgSchedule);
117: }
118:
119: public PropertyGroup removeLocalPG(Class c) {
120: PropertyGroup removed = null;
121: if (PackagePG.class.equals(c)) {
122: removed = myPackagePG;
123: myPackagePG = null;
124: } else {
125: removed = super .removeLocalPG(c);
126: }
127: return removed;
128: }
129:
130: public PropertyGroup removeLocalPG(PropertyGroup pg) {
131: Class pgc = pg.getPrimaryClass();
132: if (PackagePG.class.equals(pgc)) {
133: PropertyGroup removed = myPackagePG;
134: myPackagePG = null;
135: return removed;
136: } else {
137: }
138: return super .removeLocalPG(pg);
139: }
140:
141: public PropertyGroupSchedule removeLocalPGSchedule(Class c) {
142: {
143: return super .removeLocalPGSchedule(c);
144: }
145: }
146:
147: public PropertyGroup generateDefaultPG(Class c) {
148: if (PackagePG.class.equals(c)) {
149: return (myPackagePG = new PackagePGImpl());
150: } else
151: return super .generateDefaultPG(c);
152: }
153:
154: // dumb serialization methods
155:
156: private void writeObject(ObjectOutputStream out) throws IOException {
157: out.defaultWriteObject();
158: if (myPackagePG instanceof Null_PG
159: || myPackagePG instanceof Future_PG) {
160: out.writeObject(null);
161: } else {
162: out.writeObject(myPackagePG);
163: }
164: }
165:
166: private void readObject(ObjectInputStream in)
167: throws ClassNotFoundException, IOException {
168: in.defaultReadObject();
169: myPackagePG = (PackagePG) in.readObject();
170: }
171:
172: // beaninfo support
173: private static PropertyDescriptor properties[];
174: static {
175: try {
176: properties = new PropertyDescriptor[1];
177: properties[0] = new PropertyDescriptor("PackagePG",
178: ClassIIClothingAndEquipment.class, "getPackagePG",
179: null);
180: } catch (IntrospectionException ie) {
181: }
182: }
183:
184: public PropertyDescriptor[] getPropertyDescriptors() {
185: PropertyDescriptor[] pds = super .getPropertyDescriptors();
186: PropertyDescriptor[] ps = new PropertyDescriptor[pds.length + 1];
187: System.arraycopy(pds, 0, ps, 0, pds.length);
188: System.arraycopy(properties, 0, ps, pds.length, 1);
189: return ps;
190: }
191: }
|