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 Level3 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 Level3(frameSet, uid);
021: }
022: };
023: DataFrame.registerFrameMaker(
024: "org.cougaar.core.qos.frame.scale", "level3", __fm);
025: }
026: private String level3SlotString;
027: private float level3SlotFloat;
028:
029: public Level3(UID uid) {
030: this (null, uid);
031: }
032:
033: public Level3(FrameSet frameSet, UID uid) {
034: super (frameSet, uid);
035: initializeLevel3SlotString("Three");
036: initializeLevel3SlotFloat(3.0f);
037: }
038:
039: public String getKind() {
040: return "level3";
041: }
042:
043: protected void collectSlotValues(java.util.Properties __props) {
044: super .collectSlotValues(__props);
045: Object __value;
046: __value = getLevel3SlotString__AsObject();
047: __props
048: .put("level3SlotString", __value != null ? __value
049: : NIL);
050: __value = getLevel3SlotFloat__AsObject();
051: __props.put("level3SlotFloat", __value != null ? __value : NIL);
052: }
053:
054: protected void collectContainerSlotValues(
055: java.util.Properties __props) {
056: super .collectContainerSlotValues(__props);
057: Object __value;
058: __value = getLevel1SlotString__AsObject();
059: __props
060: .put("level1SlotString", __value != null ? __value
061: : NIL);
062: __value = getRootSlotFloat__AsObject();
063: __props.put("rootSlotFloat", __value != null ? __value : NIL);
064: __value = getLevel2SlotString__AsObject();
065: __props
066: .put("level2SlotString", __value != null ? __value
067: : NIL);
068: __value = getLevel2SlotFloat__AsObject();
069: __props.put("level2SlotFloat", __value != null ? __value : NIL);
070: __value = getLevel1SlotFloat__AsObject();
071: __props.put("level1SlotFloat", __value != null ? __value : NIL);
072: __value = getRootSlotString__AsObject();
073: __props.put("rootSlotString", __value != null ? __value : NIL);
074: }
075:
076: public String getLevel3SlotString() {
077: return level3SlotString;
078: }
079:
080: String getLevel3SlotString__NoWarn() {
081: return level3SlotString;
082: }
083:
084: Object getLevel3SlotString__AsObject() {
085: return level3SlotString;
086: }
087:
088: public void setLevel3SlotString(String __new_value) {
089: String __old_value = level3SlotString;
090: this .level3SlotString = __new_value;
091: slotModified("level3SlotString", __old_value, __new_value,
092: true, true);
093: }
094:
095: public void setLevel3SlotString__AsObject(Object __new_value) {
096: Object __old_value = getLevel3SlotString__AsObject();
097: this .level3SlotString = force_String(__new_value);
098: slotModified("level3SlotString", __old_value, __new_value,
099: true, true);
100: }
101:
102: protected void initializeLevel3SlotString(String new_value) {
103: this .level3SlotString = new_value;
104: slotInitialized("level3SlotString", new_value);
105: }
106:
107: void initializeLevel3SlotString__AsObject(Object new_value) {
108: this .level3SlotString = force_String(new_value);
109: slotInitialized("level3SlotString", new_value);
110: }
111:
112: public float getLevel3SlotFloat() {
113: return level3SlotFloat;
114: }
115:
116: float getLevel3SlotFloat__NoWarn() {
117: return level3SlotFloat;
118: }
119:
120: Object getLevel3SlotFloat__AsObject() {
121: return new Float(level3SlotFloat);
122: }
123:
124: public void setLevel3SlotFloat(float __new_value) {
125: float __old_value = level3SlotFloat;
126: this .level3SlotFloat = __new_value;
127: slotModified("level3SlotFloat", new Float(__old_value),
128: new Float(__new_value), true, true);
129: }
130:
131: public void setLevel3SlotFloat__AsObject(Object __new_value) {
132: Object __old_value = getLevel3SlotFloat__AsObject();
133: this .level3SlotFloat = force_float(__new_value);
134: slotModified("level3SlotFloat", __old_value, __new_value, true,
135: true);
136: }
137:
138: protected void initializeLevel3SlotFloat(float new_value) {
139: this .level3SlotFloat = new_value;
140: slotInitialized("level3SlotFloat", new Float(new_value));
141: }
142:
143: void initializeLevel3SlotFloat__AsObject(Object new_value) {
144: this .level3SlotFloat = force_float(new_value);
145: slotInitialized("level3SlotFloat", new_value);
146: }
147:
148: public String getLevel1SlotString() {
149: Object __raw_container = containerFrame();
150: if (__raw_container == null)
151: return "One";
152: if (!(__raw_container instanceof Level2))
153: throw new RuntimeException("Bogus container!");
154: Level2 __container = (Level2) __raw_container;
155: return __container.getLevel1SlotString();
156: }
157:
158: Object getLevel1SlotString__AsObject() {
159: Object __raw_container = containerFrame();
160: if (__raw_container == null)
161: return "One";
162: if (!(__raw_container instanceof Level2)) {
163: getLogger().warn(
164: "Container of " + this + " is not a Level2: "
165: + __raw_container);
166: return null;
167: }
168: Level2 __container = (Level2) __raw_container;
169: return __container.getLevel1SlotString__AsObject();
170: }
171:
172: public float getRootSlotFloat() {
173: Object __raw_container = containerFrame();
174: if (__raw_container == null)
175: return 0.0f;
176: if (!(__raw_container instanceof Level2))
177: throw new RuntimeException("Bogus container!");
178: Level2 __container = (Level2) __raw_container;
179: return __container.getRootSlotFloat();
180: }
181:
182: Object getRootSlotFloat__AsObject() {
183: Object __raw_container = containerFrame();
184: if (__raw_container == null)
185: return 0.0f;
186: if (!(__raw_container instanceof Level2)) {
187: getLogger().warn(
188: "Container of " + this + " is not a Level2: "
189: + __raw_container);
190: return null;
191: }
192: Level2 __container = (Level2) __raw_container;
193: return __container.getRootSlotFloat__AsObject();
194: }
195:
196: public String getLevel2SlotString() {
197: Object __raw_container = containerFrame();
198: if (__raw_container == null)
199: return "Two";
200: if (!(__raw_container instanceof Level2))
201: throw new RuntimeException("Bogus container!");
202: Level2 __container = (Level2) __raw_container;
203: return __container.getLevel2SlotString();
204: }
205:
206: Object getLevel2SlotString__AsObject() {
207: Object __raw_container = containerFrame();
208: if (__raw_container == null)
209: return "Two";
210: if (!(__raw_container instanceof Level2)) {
211: getLogger().warn(
212: "Container of " + this + " is not a Level2: "
213: + __raw_container);
214: return null;
215: }
216: Level2 __container = (Level2) __raw_container;
217: return __container.getLevel2SlotString__AsObject();
218: }
219:
220: public float getLevel2SlotFloat() {
221: Object __raw_container = containerFrame();
222: if (__raw_container == null)
223: return 2.0f;
224: if (!(__raw_container instanceof Level2))
225: throw new RuntimeException("Bogus container!");
226: Level2 __container = (Level2) __raw_container;
227: return __container.getLevel2SlotFloat();
228: }
229:
230: Object getLevel2SlotFloat__AsObject() {
231: Object __raw_container = containerFrame();
232: if (__raw_container == null)
233: return 2.0f;
234: if (!(__raw_container instanceof Level2)) {
235: getLogger().warn(
236: "Container of " + this + " is not a Level2: "
237: + __raw_container);
238: return null;
239: }
240: Level2 __container = (Level2) __raw_container;
241: return __container.getLevel2SlotFloat__AsObject();
242: }
243:
244: public float getLevel1SlotFloat() {
245: Object __raw_container = containerFrame();
246: if (__raw_container == null)
247: return 1.0f;
248: if (!(__raw_container instanceof Level2))
249: throw new RuntimeException("Bogus container!");
250: Level2 __container = (Level2) __raw_container;
251: return __container.getLevel1SlotFloat();
252: }
253:
254: Object getLevel1SlotFloat__AsObject() {
255: Object __raw_container = containerFrame();
256: if (__raw_container == null)
257: return 1.0f;
258: if (!(__raw_container instanceof Level2)) {
259: getLogger().warn(
260: "Container of " + this + " is not a Level2: "
261: + __raw_container);
262: return null;
263: }
264: Level2 __container = (Level2) __raw_container;
265: return __container.getLevel1SlotFloat__AsObject();
266: }
267:
268: public String getRootSlotString() {
269: Object __raw_container = containerFrame();
270: if (__raw_container == null)
271: return "Zero";
272: if (!(__raw_container instanceof Level2))
273: throw new RuntimeException("Bogus container!");
274: Level2 __container = (Level2) __raw_container;
275: return __container.getRootSlotString();
276: }
277:
278: Object getRootSlotString__AsObject() {
279: Object __raw_container = containerFrame();
280: if (__raw_container == null)
281: return "Zero";
282: if (!(__raw_container instanceof Level2)) {
283: getLogger().warn(
284: "Container of " + this + " is not a Level2: "
285: + __raw_container);
286: return null;
287: }
288: Level2 __container = (Level2) __raw_container;
289: return __container.getRootSlotString__AsObject();
290: }
291:
292: protected void fireContainerChanges(DataFrame __raw_old,
293: DataFrame __raw_new) {
294: if (!(__raw_old instanceof Level2)) {
295: getLogger().warn(
296: "Container of " + this + " is not a Level2: "
297: + __raw_old);
298: return;
299: }
300: if (!(__raw_new instanceof Level2)) {
301: getLogger().warn(
302: "Container of " + this + " is not a Level2: "
303: + __raw_new);
304: return;
305: }
306: Level2 __old_frame = (Level2) __raw_old;
307: Level2 __new_frame = (Level2) __raw_new;
308: Object __old;
309: Object __new;
310: __old = __old_frame.getLevel1SlotString__AsObject();
311: __new = __new_frame.getLevel1SlotString__AsObject();
312: if (__new != null) {
313: if (__old == null || !__old.equals(__new)) {
314: fireChange("level1SlotString", __old, __new);
315: }
316: }
317: __old = __old_frame.getRootSlotFloat__AsObject();
318: __new = __new_frame.getRootSlotFloat__AsObject();
319: if (__new != null) {
320: if (__old == null || !__old.equals(__new)) {
321: fireChange("rootSlotFloat", __old, __new);
322: }
323: }
324: __old = __old_frame.getLevel2SlotString__AsObject();
325: __new = __new_frame.getLevel2SlotString__AsObject();
326: if (__new != null) {
327: if (__old == null || !__old.equals(__new)) {
328: fireChange("level2SlotString", __old, __new);
329: }
330: }
331: __old = __old_frame.getLevel2SlotFloat__AsObject();
332: __new = __new_frame.getLevel2SlotFloat__AsObject();
333: if (__new != null) {
334: if (__old == null || !__old.equals(__new)) {
335: fireChange("level2SlotFloat", __old, __new);
336: }
337: }
338: __old = __old_frame.getLevel1SlotFloat__AsObject();
339: __new = __new_frame.getLevel1SlotFloat__AsObject();
340: if (__new != null) {
341: if (__old == null || !__old.equals(__new)) {
342: fireChange("level1SlotFloat", __old, __new);
343: }
344: }
345: __old = __old_frame.getRootSlotString__AsObject();
346: __new = __new_frame.getRootSlotString__AsObject();
347: if (__new != null) {
348: if (__old == null || !__old.equals(__new)) {
349: fireChange("rootSlotString", __old, __new);
350: }
351: }
352: }
353:
354: protected void fireContainerChanges(DataFrame __raw) {
355: if (!(__raw instanceof Level2)) {
356: getLogger().warn(
357: "Container of " + this + " is not a Level2: "
358: + __raw);
359: return;
360: }
361: Level2 __new_frame = (Level2) __raw;
362: Object __new;
363: __new = __new_frame.getLevel1SlotString__AsObject();
364: if (__new != null) {
365: fireChange("level1SlotString", null, __new);
366: }
367: __new = __new_frame.getRootSlotFloat__AsObject();
368: if (__new != null) {
369: fireChange("rootSlotFloat", null, __new);
370: }
371: __new = __new_frame.getLevel2SlotString__AsObject();
372: if (__new != null) {
373: fireChange("level2SlotString", null, __new);
374: }
375: __new = __new_frame.getLevel2SlotFloat__AsObject();
376: if (__new != null) {
377: fireChange("level2SlotFloat", null, __new);
378: }
379: __new = __new_frame.getLevel1SlotFloat__AsObject();
380: if (__new != null) {
381: fireChange("level1SlotFloat", null, __new);
382: }
383: __new = __new_frame.getRootSlotString__AsObject();
384: if (__new != null) {
385: fireChange("rootSlotString", null, __new);
386: }
387: }
388:
389: protected Object getLocalValue(String __slot) {
390: String __key = __slot.intern();
391: if ("rootSlotFloat" == __key)
392: return getRootSlotFloat__AsObject();
393: else if ("level1SlotString" == __key)
394: return getLevel1SlotString__AsObject();
395: else if ("level2SlotString" == __key)
396: return getLevel2SlotString__AsObject();
397: else if ("level2SlotFloat" == __key)
398: return getLevel2SlotFloat__AsObject();
399: else if ("level3SlotString" == __key)
400: return getLevel3SlotString__AsObject();
401: else if ("level1SlotFloat" == __key)
402: return getLevel1SlotFloat__AsObject();
403: else if ("name" == __key)
404: return getName__AsObject();
405: else if ("level3SlotFloat" == __key)
406: return getLevel3SlotFloat__AsObject();
407: else if ("rootSlotString" == __key)
408: return getRootSlotString__AsObject();
409: else
410: return super .getLocalValue(__slot);
411: }
412:
413: protected void setLocalValue(String __slot, Object __value) {
414: String __key = __slot.intern();
415: if ("level3SlotString" == __key)
416: setLevel3SlotString__AsObject(__value);
417: else if ("level3SlotFloat" == __key)
418: setLevel3SlotFloat__AsObject(__value);
419: else
420: super .setLocalValue(__slot, __value);
421: }
422:
423: protected void initializeLocalValue(String __slot, Object __value) {
424: String __key = __slot.intern();
425: if ("level3SlotString" == __key)
426: initializeLevel3SlotString__AsObject(__value);
427: else if ("level3SlotFloat" == __key)
428: initializeLevel3SlotFloat__AsObject(__value);
429: else
430: super .initializeLocalValue(__slot, __value);
431: }
432:
433: protected void collectSlotNames(java.util.Set<String> slots) {
434: super .collectSlotNames(slots);
435: slots.add("level3SlotString");
436: slots.add("level3SlotFloat");
437: slots.add("level1SlotString");
438: slots.add("rootSlotFloat");
439: slots.add("level2SlotString");
440: slots.add("level2SlotFloat");
441: slots.add("level1SlotFloat");
442: slots.add("rootSlotString");
443: }
444:
445: public SlotDescription slotMetaData__Level3SlotString() {
446: SlotDescription __desc = new SlotDescription();
447: __desc.name = "level3SlotString";
448: __desc.prototype = "level3";
449: __desc.is_writable = true;
450: Object __value;
451: __value = level3SlotString;
452: if (__value != null) {
453: __desc.is_overridden = true;
454: __desc.value = __value;
455: } else {
456: __desc.is_overridden = false;
457: __desc.value = "Three";
458: }
459: return __desc;
460: }
461:
462: public SlotDescription slotMetaData__Level3SlotFloat() {
463: SlotDescription __desc = new SlotDescription();
464: __desc.name = "level3SlotFloat";
465: __desc.prototype = "level3";
466: __desc.is_writable = true;
467: Object __value;
468: __value = new Float(level3SlotFloat);
469: if (__value != null) {
470: __desc.is_overridden = true;
471: __desc.value = __value;
472: } else {
473: __desc.is_overridden = false;
474: __desc.value = new Float(3.0f);
475: }
476: return __desc;
477: }
478:
479: public SlotDescription slotMetaData__Level1SlotString() {
480: SlotDescription __desc = new SlotDescription();
481: __desc.name = "level1SlotString";
482: __desc.prototype = "level1";
483: __desc.value = getLevel1SlotString__AsObject();
484: __desc.is_overridden = false;
485: __desc.is_writable = false;
486: return __desc;
487: }
488:
489: public SlotDescription slotMetaData__RootSlotFloat() {
490: SlotDescription __desc = new SlotDescription();
491: __desc.name = "rootSlotFloat";
492: __desc.prototype = "root";
493: __desc.value = getRootSlotFloat__AsObject();
494: __desc.is_overridden = false;
495: __desc.is_writable = false;
496: return __desc;
497: }
498:
499: public SlotDescription slotMetaData__Level2SlotString() {
500: SlotDescription __desc = new SlotDescription();
501: __desc.name = "level2SlotString";
502: __desc.prototype = "level2";
503: __desc.value = getLevel2SlotString__AsObject();
504: __desc.is_overridden = false;
505: __desc.is_writable = false;
506: return __desc;
507: }
508:
509: public SlotDescription slotMetaData__Level2SlotFloat() {
510: SlotDescription __desc = new SlotDescription();
511: __desc.name = "level2SlotFloat";
512: __desc.prototype = "level2";
513: __desc.value = getLevel2SlotFloat__AsObject();
514: __desc.is_overridden = false;
515: __desc.is_writable = false;
516: return __desc;
517: }
518:
519: public SlotDescription slotMetaData__Level1SlotFloat() {
520: SlotDescription __desc = new SlotDescription();
521: __desc.name = "level1SlotFloat";
522: __desc.prototype = "level1";
523: __desc.value = getLevel1SlotFloat__AsObject();
524: __desc.is_overridden = false;
525: __desc.is_writable = false;
526: return __desc;
527: }
528:
529: public SlotDescription slotMetaData__RootSlotString() {
530: SlotDescription __desc = new SlotDescription();
531: __desc.name = "rootSlotString";
532: __desc.prototype = "root";
533: __desc.value = getRootSlotString__AsObject();
534: __desc.is_overridden = false;
535: __desc.is_writable = false;
536: return __desc;
537: }
538:
539: protected void collectSlotDescriptions(
540: java.util.Map<String, SlotDescription> map) {
541: super .collectSlotDescriptions(map);
542: map.put("level3SlotString", slotMetaData__Level3SlotString());
543: map.put("level3SlotFloat", slotMetaData__Level3SlotFloat());
544: map.put("level1SlotString", slotMetaData__Level1SlotString());
545: map.put("rootSlotFloat", slotMetaData__RootSlotFloat());
546: map.put("level2SlotString", slotMetaData__Level2SlotString());
547: map.put("level2SlotFloat", slotMetaData__Level2SlotFloat());
548: map.put("level1SlotFloat", slotMetaData__Level1SlotFloat());
549: map.put("rootSlotString", slotMetaData__RootSlotString());
550: }
551: }
|