Moab Viewpoint
Integer Deciders

Integer Deciders

Whenever the XML allows an integer decider (instead of a concrete integer), these are the valid options:

  • A binary operation calculation.
  • Other operations.
  • A concrete integer.
  • A UI component that holds an integer (such as <component id="nameOfNumberSpinner" />) inside the parent element. If the component holds a string value, Viewpoint attempts to parse this value to an integer.

Binary Operations

All binary operations require <first> and <second> elements (which themselves could be deciders). The type of decider is dependent on the binary-operation attribute value.

Addition

The add binary operation string decider requires a integer decider for both the <first> and <second> elements. The result is the sum of the two numbers. To specify an add operation, use the "add" attribute value for the binary-operation attribute.

In this example, 60 is added to the "disk" component.

<calculate binary-operation="add">
 <first>
  <component id="disk" />
 </first>
 <second>60</second>
</calculate>

Multiply

The multiply binary operation string decider requires an integer decider for both the <first> and <second> elements. The result is the product of the two numbers. To specify multiplication operation, use the "multiply" attribute value for the binary-operation attribute.

Other Operations

Other operations require the operation attribute on the <calculate> element. The attribute value determines the type of operation.

  • "string-to-int" - Requires a child string decider. Evaluates the string then attempts to parse it to an integer.