Difference between revisions of "Core.DataTypes.ComplexDataType.Map"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:Data Type '''Map'''}} == Classification == {{ClassificationDataType | Map | Collection of key-value pairs of the same type | Simple Data Type | - | Literal=...") |
|||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Data Type '''Map'''}} | {{DISPLAYTITLE:Data Type '''Map'''}} | ||
== Classification == | == Classification == | ||
− | {{ClassificationDataType | Map | Collection of key-value pairs of the same type | [[Simple Data Type]] | | + | {{ClassificationDataType | Map | Collection of key-value pairs of the same type | [[Core.DataTypes.SimpleDataType|Simple Data Type]] | [[Core.DataTypes.ComplexDataType.ComplexType|ComplexType]] | DefaultValue=An empty map|Literal=Yes | SpecifiedBy={{OtxSpec2}}<!-- Go to the Template:OtxSpec2 in case of updating the info --> }} |
== Description == | == Description == | ||
The '''Map''' data type identifies OTX in a number of zero or more key-value pairs. When you declare the type of the key and the type of the value must be specified. Within a Map keys must be unique. Via the key is accessed, the values in the map. | The '''Map''' data type identifies OTX in a number of zero or more key-value pairs. When you declare the type of the key and the type of the value must be specified. Within a Map keys must be unique. Via the key is accessed, the values in the map. | ||
+ | |||
+ | {{ConversionTable | | ||
+ | String=Returns the map as a string | StringSample=<tt>String s = ToString({1:true, 2:false, 3:true}); // Returns "{1:true, 2:false, 3:true}"</tt>| | ||
+ | }} | ||
+ | |||
+ | ==Sample== | ||
+ | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | Map<Integer, Boolean> MapVariable = {1:true, 2:false, 3:true}; | ||
+ | </syntaxhighlight> |
Latest revision as of 08:55, 12 September 2019
Classification
Name | Map |
Short Description | Collection of key-value pairs of the same type |
Class | Simple Data Type |
Base Data Type | ComplexType |
Default Value | An empty map |
Provide a Literal | Yes |
SpecifiedBy | ISO 13209-2 |
Standard Compliant | Yes |
Description
The Map data type identifies OTX in a number of zero or more key-value pairs. When you declare the type of the key and the type of the value must be specified. Within a Map keys must be unique. Via the key is accessed, the values in the map.
Core Conversion
The following table shows the rules for conversion to another data type:
Conversion | Result | Sample |
ToBoolean | Undefined (should not be used) | |
ToInteger | Undefined (should not be used) | |
ToFloat | Undefined (should not be used) | |
ToString | Returns the map as a string | String s = ToString({1:true, 2:false, 3:true}); // Returns "{1:true, 2:false, 3:true}" |
ToByteField | Undefined (should not be used) |
Sample
Map<Integer, Boolean> MapVariable = {1:true, 2:false, 3:true};