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:26:06 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/albbn/src/org/cougaar/logistics/plugin/trans/properties.def - DO NOT HAND EDIT */
028: /** Primary client interface for CargoCatCodeDimensionPG.
029: * Has dimension info
030: * @see NewCargoCatCodeDimensionPG
031: * @see CargoCatCodeDimensionPGImpl
032: **/package org.cougaar.logistics.plugin.trans;
033:
034: import org.cougaar.planning.ldm.measure.*;
035: import org.cougaar.planning.ldm.asset.*;
036: import org.cougaar.planning.ldm.plan.*;
037: import java.util.*;
038:
039: import org.cougaar.glm.ldm.asset.*;
040:
041: public interface CargoCatCodeDimensionPG extends PropertyGroup {
042: /** dimensions for this cargo cat code **/
043: PhysicalPG getDimensions();
044:
045: /** cargo cat code for this chunk of level-2 aggregate. May only have one letter set if multiple assets have different cargo cat codes but same transportation category (e.g. outsize). **/
046: String getCargoCatCode();
047:
048: /** indicates whether aggregate is just containers **/
049: boolean getIsContainer();
050:
051: /** asset class of the aggregate **/
052: int getAssetClass();
053:
054: // introspection and construction
055: /** the method of factoryClass that creates this type **/
056: String factoryMethod = "newCargoCatCodeDimensionPG";
057: /** the (mutable) class type returned by factoryMethod **/
058: String mutableClass = "org.cougaar.logistics.plugin.trans.NewCargoCatCodeDimensionPG";
059: /** the factory class **/
060: Class factoryClass = org.cougaar.logistics.plugin.trans.PropertyGroupFactory.class;
061: /** the (immutable) class type returned by domain factory **/
062: Class primaryClass = org.cougaar.logistics.plugin.trans.CargoCatCodeDimensionPG.class;
063: String assetSetter = "setCargoCatCodeDimensionPG";
064: String assetGetter = "getCargoCatCodeDimensionPG";
065: /** The Null instance for indicating that the PG definitely has no value **/
066: CargoCatCodeDimensionPG nullPG = new Null_CargoCatCodeDimensionPG();
067:
068: /** Null_PG implementation for CargoCatCodeDimensionPG **/
069: final class Null_CargoCatCodeDimensionPG implements
070: CargoCatCodeDimensionPG, Null_PG {
071: public PhysicalPG getDimensions() {
072: throw new UndefinedValueException();
073: }
074:
075: public String getCargoCatCode() {
076: throw new UndefinedValueException();
077: }
078:
079: public boolean getIsContainer() {
080: throw new UndefinedValueException();
081: }
082:
083: public int getAssetClass() {
084: throw new UndefinedValueException();
085: }
086:
087: public boolean equals(Object object) {
088: throw new UndefinedValueException();
089: }
090:
091: public Object clone() throws CloneNotSupportedException {
092: throw new CloneNotSupportedException();
093: }
094:
095: public NewPropertyGroup unlock(Object key) {
096: return null;
097: }
098:
099: public PropertyGroup lock(Object key) {
100: return null;
101: }
102:
103: public PropertyGroup lock() {
104: return null;
105: }
106:
107: public PropertyGroup copy() {
108: return null;
109: }
110:
111: public Class getPrimaryClass() {
112: return primaryClass;
113: }
114:
115: public String getAssetGetMethod() {
116: return assetGetter;
117: }
118:
119: public String getAssetSetMethod() {
120: return assetSetter;
121: }
122:
123: public Class getIntrospectionClass() {
124: return CargoCatCodeDimensionPGImpl.class;
125: }
126:
127: public boolean hasDataQuality() {
128: return false;
129: }
130: }
131:
132: /** Future PG implementation for CargoCatCodeDimensionPG **/
133: final class Future implements CargoCatCodeDimensionPG, Future_PG {
134: public PhysicalPG getDimensions() {
135: waitForFinalize();
136: return _real.getDimensions();
137: }
138:
139: public String getCargoCatCode() {
140: waitForFinalize();
141: return _real.getCargoCatCode();
142: }
143:
144: public boolean getIsContainer() {
145: waitForFinalize();
146: return _real.getIsContainer();
147: }
148:
149: public int getAssetClass() {
150: waitForFinalize();
151: return _real.getAssetClass();
152: }
153:
154: public boolean equals(Object object) {
155: waitForFinalize();
156: return _real.equals(object);
157: }
158:
159: public Object clone() throws CloneNotSupportedException {
160: throw new CloneNotSupportedException();
161: }
162:
163: public NewPropertyGroup unlock(Object key) {
164: return null;
165: }
166:
167: public PropertyGroup lock(Object key) {
168: return null;
169: }
170:
171: public PropertyGroup lock() {
172: return null;
173: }
174:
175: public PropertyGroup copy() {
176: return null;
177: }
178:
179: public Class getPrimaryClass() {
180: return primaryClass;
181: }
182:
183: public String getAssetGetMethod() {
184: return assetGetter;
185: }
186:
187: public String getAssetSetMethod() {
188: return assetSetter;
189: }
190:
191: public Class getIntrospectionClass() {
192: return CargoCatCodeDimensionPGImpl.class;
193: }
194:
195: public synchronized boolean hasDataQuality() {
196: return (_real != null) && _real.hasDataQuality();
197: }
198:
199: // Finalization support
200: private CargoCatCodeDimensionPG _real = null;
201:
202: public synchronized void finalize(PropertyGroup real) {
203: if (real instanceof CargoCatCodeDimensionPG) {
204: _real = (CargoCatCodeDimensionPG) real;
205: notifyAll();
206: } else {
207: throw new IllegalArgumentException(
208: "Finalization with wrong class: " + real);
209: }
210: }
211:
212: private synchronized void waitForFinalize() {
213: while (_real == null) {
214: try {
215: wait();
216: } catch (InterruptedException _ie) {
217: // We should really let waitForFinalize throw InterruptedException
218: Thread.interrupted();
219: }
220: }
221: }
222: }
223: }
|