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:20:42 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/planning/src/org/cougaar/planning/ldm/asset/properties.def - DO NOT HAND EDIT */
028: /** Primary client interface for CommunityPG.
029: * @see NewCommunityPG
030: * @see CommunityPGImpl
031: **/package org.cougaar.planning.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 org.cougaar.util.TimeSpan;
037: import java.util.*;
038:
039: public interface CommunityPG extends TimePhasedPropertyGroup {
040: /** Collection of community names to which the asset belongs at the specified time. **/
041: Collection getCommunities();
042:
043: /** test to see if an element is a member of the communities Collection **/
044: boolean inCommunities(String element);
045:
046: /** array getter for beans **/
047: String[] getCommunitiesAsArray();
048:
049: /** indexed getter for beans **/
050: String getIndexedCommunities(int index);
051:
052: // introspection and construction
053: /** the method of factoryClass that creates this type **/
054: String factoryMethod = "newCommunityPG";
055: /** the (mutable) class type returned by factoryMethod **/
056: String mutableClass = "org.cougaar.planning.ldm.asset.NewCommunityPG";
057: /** the factory class **/
058: Class factoryClass = org.cougaar.planning.ldm.asset.PropertyGroupFactory.class;
059: /** the (immutable) class type returned by domain factory **/
060: Class primaryClass = org.cougaar.planning.ldm.asset.CommunityPG.class;
061: String assetSetter = "setCommunityPG";
062: String assetGetter = "getCommunityPG";
063: /** The Null instance for indicating that the PG definitely has no value **/
064: CommunityPG nullPG = new Null_CommunityPG();
065:
066: /** Null_PG implementation for CommunityPG **/
067: final class Null_CommunityPG implements CommunityPG, Null_PG {
068: public Collection getCommunities() {
069: throw new UndefinedValueException();
070: }
071:
072: public boolean inCommunities(String element) {
073: return false;
074: }
075:
076: public String[] getCommunitiesAsArray() {
077: return null;
078: }
079:
080: public String getIndexedCommunities(int index) {
081: throw new UndefinedValueException();
082: }
083:
084: public long getStartTime() {
085: throw new UndefinedValueException();
086: }
087:
088: public long getEndTime() {
089: throw new UndefinedValueException();
090: }
091:
092: public boolean equals(Object object) {
093: throw new UndefinedValueException();
094: }
095:
096: public Object clone() throws CloneNotSupportedException {
097: throw new CloneNotSupportedException();
098: }
099:
100: public NewPropertyGroup unlock(Object key) {
101: return null;
102: }
103:
104: public PropertyGroup lock(Object key) {
105: return null;
106: }
107:
108: public PropertyGroup lock() {
109: return null;
110: }
111:
112: public PropertyGroup copy() {
113: return null;
114: }
115:
116: public Class getPrimaryClass() {
117: return primaryClass;
118: }
119:
120: public String getAssetGetMethod() {
121: return assetGetter;
122: }
123:
124: public String getAssetSetMethod() {
125: return assetSetter;
126: }
127:
128: public Class getIntrospectionClass() {
129: return CommunityPGImpl.class;
130: }
131:
132: public boolean hasDataQuality() {
133: return false;
134: }
135: }
136:
137: /** Future PG implementation for CommunityPG **/
138: final class Future implements CommunityPG, Future_PG {
139: public Collection getCommunities() {
140: waitForFinalize();
141: return _real.getCommunities();
142: }
143:
144: public boolean inCommunities(String element) {
145: waitForFinalize();
146: return _real.inCommunities(element);
147: }
148:
149: public String[] getCommunitiesAsArray() {
150: waitForFinalize();
151: return _real.getCommunitiesAsArray();
152: }
153:
154: public String getIndexedCommunities(int index) {
155: waitForFinalize();
156: return _real.getIndexedCommunities(index);
157: }
158:
159: public boolean equals(Object object) {
160: waitForFinalize();
161: return _real.equals(object);
162: }
163:
164: public long getStartTime() {
165: waitForFinalize();
166: return _real.getStartTime();
167: }
168:
169: public long getEndTime() {
170: waitForFinalize();
171: return _real.getEndTime();
172: }
173:
174: public Object clone() throws CloneNotSupportedException {
175: throw new CloneNotSupportedException();
176: }
177:
178: public NewPropertyGroup unlock(Object key) {
179: return null;
180: }
181:
182: public PropertyGroup lock(Object key) {
183: return null;
184: }
185:
186: public PropertyGroup lock() {
187: return null;
188: }
189:
190: public PropertyGroup copy() {
191: return null;
192: }
193:
194: public Class getPrimaryClass() {
195: return primaryClass;
196: }
197:
198: public String getAssetGetMethod() {
199: return assetGetter;
200: }
201:
202: public String getAssetSetMethod() {
203: return assetSetter;
204: }
205:
206: public Class getIntrospectionClass() {
207: return CommunityPGImpl.class;
208: }
209:
210: public synchronized boolean hasDataQuality() {
211: return (_real != null) && _real.hasDataQuality();
212: }
213:
214: // Finalization support
215: private CommunityPG _real = null;
216:
217: public synchronized void finalize(PropertyGroup real) {
218: if (real instanceof CommunityPG) {
219: _real = (CommunityPG) real;
220: notifyAll();
221: } else {
222: throw new IllegalArgumentException(
223: "Finalization with wrong class: " + real);
224: }
225: }
226:
227: private synchronized void waitForFinalize() {
228: while (_real == null) {
229: try {
230: wait();
231: } catch (InterruptedException _ie) {
232: // We should really let waitForFinalize throw InterruptedException
233: Thread.interrupted();
234: }
235: }
236: }
237: }
238: }
|