org.unizone.finance.interest

Type YieldForwardPrognosis

org.unizone.0.6360
Instance of Type
Inheriting from SourceAdapterSingleTimeseries

Type dataValue
org.uninode.Type.displayPattern{att:org.unizone.source.Source.displayName}
org.unizone.source.Source.valueAttribute
org.uninode.Resource.resourceType
org.uninode.Resource.label
org.uninode.Resource.resourceOfList{}
org.uninode.Listable.resourcesReference[org.uninode.Listable.resources] of org.unizone.finance.interest.YieldForwardPrognosis

Attribute summaryDefined inUninode® IdPropertiesDefault
Reference[org.uninode.Listable.resources]resourcesListableorg.uninode.0.2001type
StringtoString
This is the display string.
Nodeorg.uninode.0.102
Typetype
The type of an object determines the behaviour and attributes of the object.
Nodeorg.uninode.0.101
StringuriNodeorg.uninode.0.103
StringlabelResourceorg.uninode.0.2041type
List[Type]resourceOfResourceorg.uninode.0.2042type
SignatureresourceType
This defines the type of resource. It can be 'view', 'adapter' or 'action'
Resourceorg.uninode.0.2043type
StringdisplayName
The display name is the name that is shown in lists, displays and graphs.
Sourceorg.unizone.0.4001essential
AttributevalueAttribute
The value attribute is used for determining the default value that should be used for displaying this source in a graph.
Sourceorg.unizone.0.4011type
inheritValue
SignaturevalueType
The value type determines which axes should be used in graphs.
Sourceorg.unizone.0.4002inheritValue
SourcesourceSourceAdapterSingleorg.unizone.0.4051

Method summaryDefined inOverridesProperties
voidactivateListable
voidcheckRangeSourceAdapterSingleSource
voiddesignEditor(WidgetWorkspace ws)Listable
voidgenerateScript(ScriptGenerationInfo info)SourceAdapterSingleScriptGenerator
Realget(DateTime timestamp)SourceAdapterSingleTimeseries
BooleanisResourceOf(Listable listable, Signature aspect)Mixabletype
ListablemixOn(Mixable mix)Mixable
ListablemixWith(Mixable mix)Mixable
voidput(DateTime timestamp, Real value)SourceAdapterSingleTimeseries
StringresourceStringListableintrospection
voidsetSource(Source source)SourceAdapterSingle
SourcesourceSourceAdapterSingle
voidXXXcom.nodelab.java.sourceadaptersingle.CheckRangeSourceAdapterSingle
SignatureXXXcom.nodelab.java.sourceadaptersingle.ValueTypeSourceAdapterSingle
voidcom.nodelab.java.source.ActivateSourceListable
Listablecom.nodelab.java.source.MixWithMiSourceMixable

Script summary
org.unizone.0.8539
/*
instance AdaptorYieldForward adaptor;
instance Value[Int] years;
instance Value[Int] days;
constructor() {
  Source:();
  instance years = new Value(Int, 1);
  instance years.addListener(Void () {changedHistory()});
  instance days = new Value(Int, 0);
  instance days.addListener(Void () {changedHistory()});
}
constructor(AdaptorYieldForward adaptor, Int years, Int days) {
  Source:();
  instance adaptor = adaptor;
  addNextSource(adaptor);
  instance years = new Value(Int, years);
  instance years.addListener(Void () {changedHistory()});
  instance days = new Value(Int, days);
  instance days.addListener(Void () {changedHistory()});
}
class Boolean isResourceOf(Listable node, Symbol aspect) {
  if (aspect == #adaptors) return true;
  false;
}
class String resourceLabel() "Name of resource" {
  "forward yield prognosis";
}
String resourceString() "Description of resource" {
  "progn. " + instance adaptor.toString + " (" + 
    instance years.toString + "y, " + 
    instance days.toString + "d)";
}
Void designEditor(WidgetWorkspace ws) {
  ws.addLabel(new Place(0, 0).setPadding(5, 5), "Years");
  ws.addField(new Place(1, 0).setPadding(20, 5), instance years, null);
  ws.addLabel(new Place(0, 1).setPadding(5, 5), "Days");
  ws.addField(new Place(1, 1).setPadding(20, 5), instance days, null);
}
Symbol valueType() {#rate;}
Void setAdaptor(AdaptorYieldForward adaptor, Int years, Int days) {
  instance adaptor = adaptor;
  addNextSource(adaptor);
  instance years.set(years);
  instance days.set(days);
}
Mixable mixWith(Mixable item) {
  Object adaptor = Producer.mix(0);
  if (adaptor == null'  '!adaptor.class.subclassOf(AdaptorYieldForward)) {
    Producer.report("Top mix must be a forward yield adaptor");
    return null;
  }
  setAdaptor(AdaptorYieldForward{adaptor}, 1, 0);
  this;
}
Collection[Class] requiredConditions() {
  #(ConditionMaturity, ConditionHistory, ConditionForward);
}
Object preferredFrom(Condition condition) {
  if (condition.class == ConditionHistory) 
    return Time{ConditionHistory{condition}.to}.addDays(-30);
  Source:preferredFrom(condition);
}
Real aspectReal(Symbol aspect) {
  if (aspect != #value) return null;
  external cond_forward = external cond_maturity;
  if (instance years.value == 0)
    external cond_maturity = instance days.value/365;
  else
    external cond_maturity = instance years.value + instance days.value / 360;
  instance adaptor.aspectReal(#value);
}
Object aspectValue(Symbol aspect) {
  if (aspect != #value) return null;
  external cond_forward = external cond_maturity;
  if (instance years.value == 0)
    external cond_maturity = instance days.value/365;
  else
    external cond_maturity = instance years.value + instance days.value / 360;
  instance adaptor.aspectReal(#value);
}
String instanceScript(InstanceScriptInfo info) {
  instance adaptor.instanceScript(info); // create variables
  info.objectId(this, AdaptorYieldForwardPrognosis, "prog");
}
String initScript(InstanceScriptInfo info) {
  "  " + info.methodPrefix(this) + "setAdaptor(" + 
    instance adaptor.instanceScript(info) + ", " + 
    instance years.value + ", " + 
    instance days.value + ");
";
}
*/