Cameo Simulation Toolkit 2021x Documentation

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

You can use the following API to specify a structural feature value:

public static void setValue(StructuredValue object, String featureName, Object value) {
...
}

The following example shows how to specify the value of the structural feature in ALH API:

value = ALH.setValue(object, "speed", "10");

If the value of an object or a featureName is null, an IllegalArgumentException will be thrown. However, null is acceptable for an assigned value.


In addition, the RuntimeObject can be omitted. The following example shows how to set a structural feature value without specifying a RuntimeObject in ALH API:

public static void setValue(String featureName, Object value) {
...
}

Information

Alternatively, you can use ALH API through the fUML object syntax, with object.setValue(featureName, value). For example:

  • value = object.setValue("speed", "10");
  • No labels