001: /*
002: * Generated by Cougaar QoS FrameGen
003: * from /Volumes/Data/Projects/cougaar/HEAD/qos/src/org/cougaar/core/qos/frame/scale/test-scale-protos.xml
004: * at Aug 3, 2006 10:09:21 AM
005: *
006: * Copyright BBN Technologies 2006
007: *
008: */
009: package org.cougaar.core.qos.frame.scale;
010:
011: import org.cougaar.core.qos.frame.DataFrame;
012: import org.cougaar.core.qos.frame.FrameSet;
013: import org.cougaar.core.qos.frame.SlotDescription;
014: import org.cougaar.core.util.UID;
015:
016: public class Level1 extends Thing {
017: static {
018: org.cougaar.core.qos.frame.FrameMaker __fm = new org.cougaar.core.qos.frame.FrameMaker() {
019: public DataFrame makeFrame(FrameSet frameSet, UID uid) {
020: return new Level1(frameSet, uid);
021: }
022: };
023: DataFrame.registerFrameMaker(
024: "org.cougaar.core.qos.frame.scale", "level1", __fm);
025: }
026: private String level1SlotString;
027: private float level1SlotFloat;
028:
029: public Level1(UID uid) {
030: this (null, uid);
031: }
032:
033: public Level1(FrameSet frameSet, UID uid) {
034: super (frameSet, uid);
035: initializeLevel1SlotString("One");
036: initializeLevel1SlotFloat(1.0f);
037: }
038:
039: public String getKind() {
040: return "level1";
041: }
042:
043: protected void collectSlotValues(java.util.Properties __props) {
044: super .collectSlotValues(__props);
045: Object __value;
046: __value = getLevel1SlotString__AsObject();
047: __props
048: .put("level1SlotString", __value != null ? __value
049: : NIL);
050: __value = getLevel1SlotFloat__AsObject();
051: __props.put("level1SlotFloat", __value != null ? __value : NIL);
052: }
053:
054: protected void collectContainerSlotValues(
055: java.util.Properties __props) {
056: super .collectContainerSlotValues(__props);
057: Object __value;
058: __value = getRootSlotFloat__AsObject();
059: __props.put("rootSlotFloat", __value != null ? __value : NIL);
060: __value = getRootSlotString__AsObject();
061: __props.put("rootSlotString", __value != null ? __value : NIL);
062: }
063:
064: public String getLevel1SlotString() {
065: return level1SlotString;
066: }
067:
068: String getLevel1SlotString__NoWarn() {
069: return level1SlotString;
070: }
071:
072: Object getLevel1SlotString__AsObject() {
073: return level1SlotString;
074: }
075:
076: public void setLevel1SlotString(String __new_value) {
077: String __old_value = level1SlotString;
078: this .level1SlotString = __new_value;
079: slotModified("level1SlotString", __old_value, __new_value,
080: true, true);
081: }
082:
083: public void setLevel1SlotString__AsObject(Object __new_value) {
084: Object __old_value = getLevel1SlotString__AsObject();
085: this .level1SlotString = force_String(__new_value);
086: slotModified("level1SlotString", __old_value, __new_value,
087: true, true);
088: }
089:
090: protected void initializeLevel1SlotString(String new_value) {
091: this .level1SlotString = new_value;
092: slotInitialized("level1SlotString", new_value);
093: }
094:
095: void initializeLevel1SlotString__AsObject(Object new_value) {
096: this .level1SlotString = force_String(new_value);
097: slotInitialized("level1SlotString", new_value);
098: }
099:
100: public float getLevel1SlotFloat() {
101: return level1SlotFloat;
102: }
103:
104: float getLevel1SlotFloat__NoWarn() {
105: return level1SlotFloat;
106: }
107:
108: Object getLevel1SlotFloat__AsObject() {
109: return new Float(level1SlotFloat);
110: }
111:
112: public void setLevel1SlotFloat(float __new_value) {
113: float __old_value = level1SlotFloat;
114: this .level1SlotFloat = __new_value;
115: slotModified("level1SlotFloat", new Float(__old_value),
116: new Float(__new_value), true, true);
117: }
118:
119: public void setLevel1SlotFloat__AsObject(Object __new_value) {
120: Object __old_value = getLevel1SlotFloat__AsObject();
121: this .level1SlotFloat = force_float(__new_value);
122: slotModified("level1SlotFloat", __old_value, __new_value, true,
123: true);
124: }
125:
126: protected void initializeLevel1SlotFloat(float new_value) {
127: this .level1SlotFloat = new_value;
128: slotInitialized("level1SlotFloat", new Float(new_value));
129: }
130:
131: void initializeLevel1SlotFloat__AsObject(Object new_value) {
132: this .level1SlotFloat = force_float(new_value);
133: slotInitialized("level1SlotFloat", new_value);
134: }
135:
136: public float getRootSlotFloat() {
137: Object __raw_container = containerFrame();
138: if (__raw_container == null)
139: return 0.0f;
140: if (!(__raw_container instanceof Root))
141: throw new RuntimeException("Bogus container!");
142: Root __container = (Root) __raw_container;
143: return __container.getRootSlotFloat();
144: }
145:
146: Object getRootSlotFloat__AsObject() {
147: Object __raw_container = containerFrame();
148: if (__raw_container == null)
149: return 0.0f;
150: if (!(__raw_container instanceof Root)) {
151: getLogger().warn(
152: "Container of " + this + " is not a Root: "
153: + __raw_container);
154: return null;
155: }
156: Root __container = (Root) __raw_container;
157: return __container.getRootSlotFloat__AsObject();
158: }
159:
160: public String getRootSlotString() {
161: Object __raw_container = containerFrame();
162: if (__raw_container == null)
163: return "Zero";
164: if (!(__raw_container instanceof Root))
165: throw new RuntimeException("Bogus container!");
166: Root __container = (Root) __raw_container;
167: return __container.getRootSlotString();
168: }
169:
170: Object getRootSlotString__AsObject() {
171: Object __raw_container = containerFrame();
172: if (__raw_container == null)
173: return "Zero";
174: if (!(__raw_container instanceof Root)) {
175: getLogger().warn(
176: "Container of " + this + " is not a Root: "
177: + __raw_container);
178: return null;
179: }
180: Root __container = (Root) __raw_container;
181: return __container.getRootSlotString__AsObject();
182: }
183:
184: protected void fireContainerChanges(DataFrame __raw_old,
185: DataFrame __raw_new) {
186: if (!(__raw_old instanceof Root)) {
187: getLogger().warn(
188: "Container of " + this + " is not a Root: "
189: + __raw_old);
190: return;
191: }
192: if (!(__raw_new instanceof Root)) {
193: getLogger().warn(
194: "Container of " + this + " is not a Root: "
195: + __raw_new);
196: return;
197: }
198: Root __old_frame = (Root) __raw_old;
199: Root __new_frame = (Root) __raw_new;
200: Object __old;
201: Object __new;
202: __old = __old_frame.getRootSlotFloat__AsObject();
203: __new = __new_frame.getRootSlotFloat__AsObject();
204: if (__new != null) {
205: if (__old == null || !__old.equals(__new)) {
206: fireChange("rootSlotFloat", __old, __new);
207: }
208: }
209: __old = __old_frame.getRootSlotString__AsObject();
210: __new = __new_frame.getRootSlotString__AsObject();
211: if (__new != null) {
212: if (__old == null || !__old.equals(__new)) {
213: fireChange("rootSlotString", __old, __new);
214: }
215: }
216: }
217:
218: protected void fireContainerChanges(DataFrame __raw) {
219: if (!(__raw instanceof Root)) {
220: getLogger()
221: .warn(
222: "Container of " + this + " is not a Root: "
223: + __raw);
224: return;
225: }
226: Root __new_frame = (Root) __raw;
227: Object __new;
228: __new = __new_frame.getRootSlotFloat__AsObject();
229: if (__new != null) {
230: fireChange("rootSlotFloat", null, __new);
231: }
232: __new = __new_frame.getRootSlotString__AsObject();
233: if (__new != null) {
234: fireChange("rootSlotString", null, __new);
235: }
236: }
237:
238: protected Object getLocalValue(String __slot) {
239: String __key = __slot.intern();
240: if ("level1SlotString" == __key)
241: return getLevel1SlotString__AsObject();
242: else if ("rootSlotFloat" == __key)
243: return getRootSlotFloat__AsObject();
244: else if ("level1SlotFloat" == __key)
245: return getLevel1SlotFloat__AsObject();
246: else if ("name" == __key)
247: return getName__AsObject();
248: else if ("rootSlotString" == __key)
249: return getRootSlotString__AsObject();
250: else
251: return super .getLocalValue(__slot);
252: }
253:
254: protected void setLocalValue(String __slot, Object __value) {
255: String __key = __slot.intern();
256: if ("level1SlotString" == __key)
257: setLevel1SlotString__AsObject(__value);
258: else if ("level1SlotFloat" == __key)
259: setLevel1SlotFloat__AsObject(__value);
260: else
261: super .setLocalValue(__slot, __value);
262: }
263:
264: protected void initializeLocalValue(String __slot, Object __value) {
265: String __key = __slot.intern();
266: if ("level1SlotString" == __key)
267: initializeLevel1SlotString__AsObject(__value);
268: else if ("level1SlotFloat" == __key)
269: initializeLevel1SlotFloat__AsObject(__value);
270: else
271: super .initializeLocalValue(__slot, __value);
272: }
273:
274: protected void collectSlotNames(java.util.Set<String> slots) {
275: super .collectSlotNames(slots);
276: slots.add("level1SlotString");
277: slots.add("level1SlotFloat");
278: slots.add("rootSlotFloat");
279: slots.add("rootSlotString");
280: }
281:
282: public SlotDescription slotMetaData__Level1SlotString() {
283: SlotDescription __desc = new SlotDescription();
284: __desc.name = "level1SlotString";
285: __desc.prototype = "level1";
286: __desc.is_writable = true;
287: Object __value;
288: __value = level1SlotString;
289: if (__value != null) {
290: __desc.is_overridden = true;
291: __desc.value = __value;
292: } else {
293: __desc.is_overridden = false;
294: __desc.value = "One";
295: }
296: return __desc;
297: }
298:
299: public SlotDescription slotMetaData__Level1SlotFloat() {
300: SlotDescription __desc = new SlotDescription();
301: __desc.name = "level1SlotFloat";
302: __desc.prototype = "level1";
303: __desc.is_writable = true;
304: Object __value;
305: __value = new Float(level1SlotFloat);
306: if (__value != null) {
307: __desc.is_overridden = true;
308: __desc.value = __value;
309: } else {
310: __desc.is_overridden = false;
311: __desc.value = new Float(1.0f);
312: }
313: return __desc;
314: }
315:
316: public SlotDescription slotMetaData__RootSlotFloat() {
317: SlotDescription __desc = new SlotDescription();
318: __desc.name = "rootSlotFloat";
319: __desc.prototype = "root";
320: __desc.value = getRootSlotFloat__AsObject();
321: __desc.is_overridden = false;
322: __desc.is_writable = false;
323: return __desc;
324: }
325:
326: public SlotDescription slotMetaData__RootSlotString() {
327: SlotDescription __desc = new SlotDescription();
328: __desc.name = "rootSlotString";
329: __desc.prototype = "root";
330: __desc.value = getRootSlotString__AsObject();
331: __desc.is_overridden = false;
332: __desc.is_writable = false;
333: return __desc;
334: }
335:
336: protected void collectSlotDescriptions(
337: java.util.Map<String, SlotDescription> map) {
338: super .collectSlotDescriptions(map);
339: map.put("level1SlotString", slotMetaData__Level1SlotString());
340: map.put("level1SlotFloat", slotMetaData__Level1SlotFloat());
341: map.put("rootSlotFloat", slotMetaData__RootSlotFloat());
342: map.put("rootSlotString", slotMetaData__RootSlotString());
343: }
344: }
|