Difference between revisions of "Extensions.Util.ListIndexOfAny"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE: '''ListIndexOfAny'''}}Category:Util == Classification == {{ClassificationActivity | ListIndexOfAny | UPDATING...<!--Create an event source for change even...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''ListIndexOfAny'''}}[[Category:Util]]
 
{{DISPLAYTITLE:  '''ListIndexOfAny'''}}[[Category:Util]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | ListIndexOfAny | UPDATING...<!--Create an event source for change event--> | [[Term]] | [[Extensions.Util|OTX Util extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | ListIndexOfAny | Gets a List of indexes of a given value in the List | [[Term]] | [[Extensions.Util|OTX Util extension]] | [[Extensions.Util#Terms|Util related terms]] | - | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
EventSourceTerm = EventHandling.MonitorChangeEventSource(Variable);
+
ListTerm Util.ListIndexOfAny(ListTerm list, Term value);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
This term shall return a list of [[Core.DataTypes.SimpleDataType.Integer|Integer]](represents Integer[]).
The OTX '''MonitorChangeEventSource''' term creates an event source that monitors the value of a variable and an event triggers when the value changed. Event queue should start immediately as soon as the event source is created.
 
  
{{Note|The case when a value to a previously uninitialized variable is assigned to count as a change event and make no mistake.}}
+
The OTX '''ListIndexOfAny''' term is an '''otx:ListTerm''' that returns a List of indexes of a given value in the List. In case the value is not contained inside the list, an empty list will be returned.  
  
{{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | '''The EventSource''', the changes in the value of a variable monitored.}}
+
{{TermReturnValue| [[Core.DataTypes.ComplexDataType.List|List]] | The List of indexes of a given value in the List. In case the value is not contained inside the list, an empty list will be returned.}}
  
 
== Properties ==
 
== Properties ==
UPDATING...//
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Variable | - | [[Variable]] | - | [1] | The variable which has to be monitored.}}
+
{{TableRowPropertie1| List | [[Core.DataTypes.ComplexDataType.List|List]] | [[Term]] | - | [1..1] | The List which shall be checked for the value.}}
 +
{{TableRowPropertie2| Value | - | [[Term]] | - | [1..1] | The value whose index in the List shall be determined.}}
 
|}
 
|}
-->
 
  
 
== OTL Examples ==
 
== OTL Examples ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean Bool1 = false;
+
/// Local Declarations
EventHandling.EventSource EventSource1;
 
EventHandling.Event Event1;
 
  
EventSource1 = EventHandling.MonitorChangeEventSource(Bool1);
+
List<Integer> List1;
parallel
+
 
{
+
/// Flow
  lane
+
 
  {
+
List1 = Util.ListIndexOfAny({&AA, &AB, &AC, &AB, &AF, &AE, &AB}, &AB);
      Bool1 = true;
 
  }
 
  lane
 
  {
 
      EventHandling.WaitForEvent({EventSource1}, Event1);
 
  }
 
}
 
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== See also ==
 
== See also ==
 
[[Extensions.Util.Compare|Compare]] <br/>
 
[[Extensions.Util.Compare|Compare]] <br/>
 
[[Extensions.Util.CopyByteField|CopyByteField]] <br/>
 
[[Extensions.Util.CopyByteField|CopyByteField]] <br/>
 +
[[Extensions.Util.GetRandomNumber|GetRandomNumber]] <br/>
 
[[Extensions.Util.IsInitialized|IsInitialized]] <br/>
 
[[Extensions.Util.IsInitialized|IsInitialized]] <br/>
 
[[Extensions.Util.ListIndexOf|ListIndexOf]] <br/>
 
[[Extensions.Util.ListIndexOf|ListIndexOf]] <br/>

Latest revision as of 05:04, 8 November 2018

Classification

Name ListIndexOfAny
Short Description Gets a List of indexes of a given value in the List
Class Term
Extension OTX Util extension
Group Util related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

ListTerm Util.ListIndexOfAny(ListTerm list, Term value);

Description

This term shall return a list of Integer(represents Integer[]).

The OTX ListIndexOfAny term is an otx:ListTerm that returns a List of indexes of a given value in the List. In case the value is not contained inside the list, an empty list will be returned.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
List The List of indexes of a given value in the List. In case the value is not contained inside the list, an empty list will be returned.

Properties

Name Data Type Class Default Cardinality Description
List List Term - [1..1] The List which shall be checked for the value.
Value - Term - [1..1] The value whose index in the List shall be determined.

OTL Examples

/// Local Declarations

List<Integer> List1;

/// Flow

List1 = Util.ListIndexOfAny({&AA, &AB, &AC, &AB, &AF, &AE, &AB}, &AB);

See also

Compare
CopyByteField
GetRandomNumber
IsInitialized
ListIndexOf
ListReverse
ListSort
Max
Min
StringFormat