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